Synchronous XMLHTTPRequests need to go to the NetworkProcess.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2013 00:45:30 +0000 (00:45 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2013 00:45:30 +0000 (00:45 +0000)
commitdd032e635e822dec9ac793df8f90f1f400c523ed
tree4443341de1ff0e0d76591e18ba4944dac51ae6d9
parentd04ef3a75909a400a725932d3719b278f208c8f5
Synchronous XMLHTTPRequests need to go to the NetworkProcess.
<rdar://problem/12951765> and https://bugs.webkit.org/show_bug.cgi?id=106826

Reviewed by Sam Weinig and Alexey Proskuryakov.

Source/WebCore:

No new tests (No changes to any config that is currently tested)

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously): Consult the LoaderStrategy when strategies are
  being used.

* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::loadResourceSynchronously): Defaults to using ResourceHandle directly.
* loader/LoaderStrategy.h:

Break out the StoredCredentials enum to a new header:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleTypes.h:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::loadResourceSynchronously): Entry point for WebCore to get
  synchronous requests to the NetworkProcess.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad): Create a SyncNetworkResourceLoader
  and schedule it.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* NetworkProcess/NetworkResourceLoadScheduler.cpp:
(WebKit::NetworkResourceLoadScheduler::scheduleSyncNetworkResourceLoader):
(WebKit::NetworkResourceLoadScheduler::servePendingRequestsForHost): Serve synchronous loaders
  before async loaders.
* NetworkProcess/NetworkResourceLoadScheduler.h:

A class that encapsulates a synchronous load request and the CoreIPC reply to be made once it is complete:
* NetworkProcess/SyncNetworkResourceLoader.cpp: Added.
(WebKit::SyncNetworkResourceLoader::SyncNetworkResourceLoader):
(WebKit::SyncNetworkResourceLoader::start):
* NetworkProcess/SyncNetworkResourceLoader.h: Copied from Source/WebKit2/NetworkProcess/HostRecord.h.
(WebKit::SyncNetworkResourceLoader::create):
(WebKit::SyncNetworkResourceLoader::setIdentifier):
(WebKit::SyncNetworkResourceLoader::identifier):
(WebKit::SyncNetworkResourceLoader::loadParameters):

Add a second queue of sync loaders:
* NetworkProcess/HostRecord.h:
(WebKit::HostRecord::syncLoadersPending):

Add comments to explicitly spell out the current reliance on some messages that are currently synchronous:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::willSendRequest):
(WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpace):

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/LoaderStrategy.cpp
Source/WebCore/loader/LoaderStrategy.h
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/ResourceHandleTypes.h [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/HostRecord.cpp
Source/WebKit2/NetworkProcess/HostRecord.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp
Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.h
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/SyncNetworkResourceLoader.cpp [new file with mode: 0644]
Source/WebKit2/NetworkProcess/SyncNetworkResourceLoader.h [new file with mode: 0644]
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h