Web process should decide when to continue main resource loads
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Apr 2013 22:56:19 +0000 (22:56 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Apr 2013 22:56:19 +0000 (22:56 +0000)
commit372aa228fb97bcde3c01d16c11c06c70fe7a31fa
treea1f5bd886446c6c6e21dcbf7063e5ed116b44d86
parent401d96687bef5a8f6bfa91b02a9a1a8d90a2f8e7
Web process should decide when to continue main resource loads
https://bugs.webkit.org/show_bug.cgi?id=114995

Reviewed by Sam Weinig.

Main resource loads can be converted to downloads, so we need the ability to let the web process decide when
to continue loading after a response has been received.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponseAsync):
For non-main resources, just call continueDidReceiveResponse directly; there's no need to ping-pong to the web process in that case.

(WebKit::NetworkResourceLoader::continueDidReceiveResponse):
Just call ResourceHandle::continueDidReceiveResponse.

* NetworkProcess/NetworkResourceLoader.messages.in:
Add ContinueDidReceiveResponse message.

* NetworkProcess/SchedulableLoader.cpp:
(WebKit::SchedulableLoader::SchedulableLoader):
Initialize m_isLoadingMainResource.

* NetworkProcess/SchedulableLoader.h:
(WebKit::SchedulableLoader::isLoadingMainResource):
Add getter.

(SchedulableLoader):
Move m_shouldClearReferrerOnHTTPSToHTTPRedirect next to the rest of the booleans.

* Shared/Network/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
(WebKit::NetworkResourceLoadParameters::encode):
(WebKit::NetworkResourceLoadParameters::decode):
* Shared/Network/NetworkResourceLoadParameters.h:
(NetworkResourceLoadParameters):
Add isMainResource flag.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad):
Pass the cached resource to scheduleLoad.

(WebKit::WebResourceLoadScheduler::schedulePluginStreamLoad):
Pass null to scheduleLoad.

(WebKit::WebResourceLoadScheduler::scheduleLoad):
Initialize isMainResource.

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
If this is a main resource load, send back a ContinueDidReceiveResponse message.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/NetworkResourceLoader.h
Source/WebKit2/NetworkProcess/NetworkResourceLoader.messages.in
Source/WebKit2/NetworkProcess/SchedulableLoader.cpp
Source/WebKit2/NetworkProcess/SchedulableLoader.h
Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp
Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.h
Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp