Changeset 154183 in webkit
- Timestamp:
- Aug 16, 2013 8:44:06 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 3 deleted
- 16 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r154182 r154183 1 2013-08-16 Brady Eidson <beidson@apple.com> 2 3 (NetworkProcess) Sync XHRs should load using async ResourceHandles, not ResourceHandle::loadResourceSynchronously 4 https://bugs.webkit.org/show_bug.cgi?id=119493 5 6 Reviewed by Alexey Proskuryakov. 7 8 No new tests (Covered by plenty of existing tests). 9 10 * WebCore.exp.in: 11 * WebCore.xcodeproj/project.pbxproj: 12 13 * platform/network/SynchronousLoaderClient.h: Make platformBadResponseError public 14 15 * platform/network/mac/ResourceHandleMac.mm: 16 (WebCore::ResourceHandle::platformLoadResourceSynchronously): Add comments/FIXMEs spelling out how wrong this code is. 17 1 18 2013-08-16 peavo@outlook.com <peavo@outlook.com> 2 19 -
trunk/Source/WebCore/WebCore.exp.in
r154160 r154183 339 339 __ZN7WebCore14ResourceBufferD1Ev 340 340 __ZN7WebCore14ResourceBufferD2Ev 341 __ZN7WebCore14ResourceHandle12firstRequestEv 341 342 __ZN7WebCore14ResourceHandle20forceContentSniffingEv 342 343 __ZN7WebCore14ResourceHandle23continueWillSendRequestERKNS_15ResourceRequestE … … 690 691 __ZN7WebCore20ResourceResponseBase6setURLERKNS_4KURLE 691 692 __ZN7WebCore20ResourceResponseBaseC2Ev 693 __ZN7WebCore20ResourceResponseBaseC2ERKNS_4KURLERKN3WTF6StringExS7_S7_ 692 694 __ZN7WebCore20SpaceSplitStringDataD1Ev 693 695 __ZN7WebCore20UserGestureIndicator7s_stateE … … 766 768 __ZN7WebCore23MutableStylePropertySet25ensureCSSStyleDeclarationEv 767 769 __ZN7WebCore23MutableStylePropertySetD1Ev 770 __ZN7WebCore23SynchronousLoaderClient24platformBadResponseErrorEv 768 771 __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0ENS2_15CrashOnOverflowEEE 769 772 __ZN7WebCore23dataForURLComponentTypeEP5NSURLl … … 810 813 __ZN7WebCore27DeviceOrientationClientMock14setOrientationEN3WTF10PassRefPtrINS_21DeviceOrientationDataEEE 811 814 __ZN7WebCore27DeviceOrientationClientMockC1Ev 815 __ZN7WebCore27protocolHostAndPortAreEqualERKNS_4KURLES2_ 812 816 __ZN7WebCore27startObservingCookieChangesEPFvvE 813 817 __ZN7WebCore28DocumentStyleSheetCollection12addUserSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r154142 r154183 5372 5372 E180811216FCF42F00B80D07 /* SynchronousLoaderClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E180811016FCF42E00B80D07 /* SynchronousLoaderClient.cpp */; }; 5373 5373 E180811616FCF9CB00B80D07 /* SynchronousLoaderClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = E180811416FCF9CB00B80D07 /* SynchronousLoaderClient.mm */; }; 5374 E180811716FCF9CB00B80D07 /* SynchronousLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E180811516FCF9CB00B80D07 /* SynchronousLoaderClient.h */; };5374 E180811716FCF9CB00B80D07 /* SynchronousLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E180811516FCF9CB00B80D07 /* SynchronousLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5375 5375 E182568F0EF2B02D00933242 /* JSWorkerGlobalScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E182568D0EF2B02D00933242 /* JSWorkerGlobalScope.cpp */; }; 5376 5376 E18256900EF2B02D00933242 /* JSWorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = E182568E0EF2B02D00933242 /* JSWorkerGlobalScope.h */; }; -
trunk/Source/WebCore/platform/network/SynchronousLoaderClient.h
r146667 r154183 48 48 bool isDone() { return m_isDone; } 49 49 50 static ResourceError platformBadResponseError(); 51 50 52 private: 51 53 SynchronousLoaderClient() … … 66 68 #endif 67 69 68 ResourceError platformBadResponseError();69 70 70 bool m_allowStoredCredentials; 71 71 ResourceResponse m_response; -
trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
r149980 r154183 318 318 response = client->response(); 319 319 else { 320 // FIXME: We might not ever need to manufacture a response: This might all be dead code. 321 // When exploring removal of this code, we should substitute appropriate ASSERTs. 320 322 response = ResourceResponse(request.url(), String(), 0, String(), String()); 321 323 if (error.domain() == String(NSURLErrorDomain)) 322 324 switch (error.errorCode()) { 323 325 case NSURLErrorUserCancelledAuthentication: 324 // FIXME: we should really return the actual HTTP response, but sendSynchronousRequest doesn't provide us with one. 326 // FIXME: We don't need to manufacture a 401 response if we say continueWithoutCredentialForAuthenticationChallenge: 327 // in which case we'll get the real failure response. A reading of SynchronousLoaderClient.mm suggests we already do this. 325 328 response.setHTTPStatusCode(401); 326 329 break; … … 328 331 response.setHTTPStatusCode(error.errorCode()); 329 332 } 330 else 333 else { 334 // FIXME: This is wrong. We shouldn't need to ever make up a 404. 331 335 response.setHTTPStatusCode(404); 332 } 336 } 337 } 333 338 334 339 data.swap(client->mutableData()); -
trunk/Source/WebKit2/ChangeLog
r154167 r154183 1 2013-08-16 Brady Eidson <beidson@apple.com> 2 3 (NetworkProcess) Sync XHRs should load using async ResourceHandles, not ResourceHandle::loadResourceSynchronously 4 https://bugs.webkit.org/show_bug.cgi?id=119493 5 6 Reviewed by Alexey Proskuryakov. 7 8 This patch does the following: 9 - Consolidates SchedulableLoader and NetworkResourceLoader into one class. 10 - Removes SyncNetworkResourceLoader. 11 - Adds a NetworkLoaderClient interface that customizes certain behaviors of the NetworkResourceLoader. 12 - Implements a SynchronousNetworkLoaderClient and AsynchronousNetworkLoaderClient for the two different types of loads. 13 14 The AsynchronousNetworkLoaderClient results in messaging back progress to the WebProcess as the load progresses. 15 The SynchronousNetworkLoaderClient accumulates the response, data, and error to be communicated back to the WebProcess 16 only when the load is complete. 17 18 Update small swaths of code to reflect that NetworkResourceLoader is the One True Loader (tm): 19 * NetworkProcess/HostRecord.cpp: 20 (WebKit::HostRecord::scheduleResourceLoader): 21 (WebKit::HostRecord::addLoaderInProgress): 22 (WebKit::removeLoaderFromQueue): 23 (WebKit::HostRecord::removeLoader): 24 (WebKit::HostRecord::servePendingRequestsForQueue): 25 (WebKit::HostRecord::limitsRequests): 26 * NetworkProcess/HostRecord.h: 27 28 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 29 (WebKit::NetworkConnectionToWebProcess::didClose): 30 (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad): 31 (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): 32 * NetworkProcess/NetworkConnectionToWebProcess.h: 33 34 * NetworkProcess/NetworkProcess.cpp: 35 * NetworkProcess/NetworkResourceLoadScheduler.cpp: 36 (WebKit::NetworkResourceLoadScheduler::scheduleLoader): 37 (WebKit::NetworkResourceLoadScheduler::removeLoader): 38 (WebKit::NetworkResourceLoadScheduler::receivedRedirect): 39 (WebKit::NetworkResourceLoadScheduler::removeScheduledLoaders): 40 (WebKit::NetworkResourceLoadScheduler::scheduleRemoveLoader): 41 * NetworkProcess/NetworkResourceLoadScheduler.h: 42 43 Combine ScheduleableLoader and NetworkResourceLoader into NetworkResourceLoader: 44 * NetworkProcess/NetworkResourceLoader.cpp: 45 (WebKit::NetworkResourceLoader::NetworkResourceLoader): 46 (WebKit::NetworkResourceLoader::~NetworkResourceLoader): 47 (WebKit::NetworkResourceLoader::isSynchronous): 48 (WebKit::NetworkResourceLoader::start): 49 (WebKit::NetworkResourceLoader::didReceiveResponseAsync): 50 (WebKit::NetworkResourceLoader::didReceiveBuffer): 51 (WebKit::NetworkResourceLoader::didFinishLoading): 52 (WebKit::NetworkResourceLoader::didFail): 53 (WebKit::NetworkResourceLoader::willSendRequestAsync): 54 (WebKit::NetworkResourceLoader::continueWillSendRequest): 55 (WebKit::NetworkResourceLoader::didSendData): 56 (WebKit::NetworkResourceLoader::shouldUseCredentialStorage): 57 (WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge): 58 (WebKit::NetworkResourceLoader::consumeSandboxExtensions): 59 (WebKit::NetworkResourceLoader::invalidateSandboxExtensions): 60 (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): 61 * NetworkProcess/NetworkResourceLoader.h: 62 (WebKit::NetworkResourceLoader::create): 63 (WebKit::NetworkResourceLoader::connectionToWebProcess): 64 (WebKit::NetworkResourceLoader::priority): 65 (WebKit::NetworkResourceLoader::request): 66 (WebKit::NetworkResourceLoader::isLoadingMainResource): 67 (WebKit::NetworkResourceLoader::setHostRecord): 68 (WebKit::NetworkResourceLoader::hostRecord): 69 (WebKit::NetworkResourceLoader::sendAbortingOnFailure): 70 71 Add an abstract NetworkLoaderClient to adapt a load to be either synchronous or asynchronous: 72 * NetworkProcess/NetworkLoaderClient.h: 73 (WebKit::NetworkLoaderClient::~NetworkLoaderClient): 74 (WebKit::NetworkLoaderClient::isSynchronous): 75 (WebKit::NetworkLoaderClient::NetworkLoaderClient): 76 77 The asynchronous loader client, primarily to message progress back to the WebProcess as it happens: 78 * NetworkProcess/AsynchronousNetworkLoaderClient.cpp: Added. 79 (WebKit::AsynchronousNetworkLoaderClient::AsynchronousNetworkLoaderClient): 80 (WebKit::AsynchronousNetworkLoaderClient::willSendRequest): 81 (WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace): 82 (WebKit::AsynchronousNetworkLoaderClient::didReceiveResponse): 83 (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer): 84 (WebKit::AsynchronousNetworkLoaderClient::didSendData): 85 (WebKit::AsynchronousNetworkLoaderClient::didFinishLoading): 86 (WebKit::AsynchronousNetworkLoaderClient::didFail): 87 * NetworkProcess/AsynchronousNetworkLoaderClient.h: 88 (WebKit::AsynchronousNetworkLoaderClient::create): 89 90 The synchronous loader client, primarily to accumulate results of the load to send back to the WebProcess all at once: 91 * NetworkProcess/SynchronousNetworkLoaderClient.cpp: Added. 92 (WebKit::SynchronousNetworkLoaderClient::SynchronousNetworkLoaderClient): 93 (WebKit::SynchronousNetworkLoaderClient::~SynchronousNetworkLoaderClient): 94 (WebKit::SynchronousNetworkLoaderClient::willSendRequest): 95 (WebKit::SynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace): 96 (WebKit::SynchronousNetworkLoaderClient::didReceiveResponse): 97 (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer): 98 (WebKit::SynchronousNetworkLoaderClient::didFinishLoading): 99 (WebKit::SynchronousNetworkLoaderClient::didFail): 100 (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply): 101 * NetworkProcess/SynchronousNetworkLoaderClient.h: Added. 102 (WebKit::SynchronousNetworkLoaderClient::create): 103 104 * NetworkProcess/SchedulableLoader.cpp: Removed. 105 * NetworkProcess/SchedulableLoader.h: Removed. 106 * NetworkProcess/SyncNetworkResourceLoader.cpp: Removed. 107 * NetworkProcess/SyncNetworkResourceLoader.h: Removed. 108 109 * WebKit2.xcodeproj/project.pbxproj: 110 1 111 2013-08-16 Gabor Rapcsanyi <rgabor@webkit.org> 2 112 -
trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.h
r154182 r154183 24 24 */ 25 25 26 #ifndef SyncNetworkResourceLoader_h27 #define SyncNetworkResourceLoader_h26 #ifndef AsynchronousNetworkLoaderClient_h 27 #define AsynchronousNetworkLoaderClient_h 28 28 29 #include "Network ConnectionToWebProcessMessages.h"30 #include "S chedulableLoader.h"31 #include <wtf/ RefCounted.h>29 #include "NetworkLoaderClient.h" 30 #include "ShareableResource.h" 31 #include <wtf/PassOwnPtr.h> 32 32 33 33 #if ENABLE(NETWORK_PROCESS) … … 35 35 namespace WebKit { 36 36 37 class SyncNetworkResourceLoader : public SchedulableLoader{37 class AsynchronousNetworkLoaderClient : public NetworkLoaderClient { 38 38 public: 39 static Pass RefPtr<SyncNetworkResourceLoader> create(const NetworkResourceLoadParameters& parameters, NetworkConnectionToWebProcess* connection, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> reply)39 static PassOwnPtr<NetworkLoaderClient> create() 40 40 { 41 return adopt Ref(new SyncNetworkResourceLoader(parameters, connection, reply));41 return adoptPtr(new AsynchronousNetworkLoaderClient()); 42 42 } 43 43 44 virtual void start() OVERRIDE; 45 virtual void abort() OVERRIDE;44 private: 45 AsynchronousNetworkLoaderClient(); 46 46 47 virtual bool isSynchronous() OVERRIDE { return true; } 48 49 private: 50 SyncNetworkResourceLoader(const NetworkResourceLoadParameters&, NetworkConnectionToWebProcess*, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>); 51 52 void cleanup(); 53 54 RefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> m_delayedReply; 47 virtual void willSendRequest(NetworkResourceLoader*, WebCore::ResourceRequest& newRequest, const WebCore::ResourceResponse& redirectResponse) OVERRIDE; 48 virtual void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader*, const WebCore::ProtectionSpace&) OVERRIDE; 49 virtual void didReceiveResponse(NetworkResourceLoader*, const WebCore::ResourceResponse&) OVERRIDE; 50 virtual void didReceiveBuffer(NetworkResourceLoader*, WebCore::SharedBuffer*, int encodedDataLength) OVERRIDE; 51 virtual void didSendData(NetworkResourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) OVERRIDE; 52 virtual void didFinishLoading(NetworkResourceLoader*, double finishTime) OVERRIDE; 53 virtual void didFail(NetworkResourceLoader*, const WebCore::ResourceError&) OVERRIDE; 55 54 }; 56 55 … … 59 58 #endif // ENABLE(NETWORK_PROCESS) 60 59 61 #endif // SyncNetworkResourceLoader_h60 #endif // AsynchronousNetworkLoaderClient_h -
trunk/Source/WebKit2/NetworkProcess/HostRecord.cpp
r151795 r154183 33 33 #include "NetworkResourceLoadScheduler.h" 34 34 #include "NetworkResourceLoader.h" 35 #include "SyncNetworkResourceLoader.h"36 35 #include <wtf/MainThread.h> 37 36 … … 57 56 } 58 57 59 void HostRecord::scheduleResourceLoader(PassRefPtr< SchedulableLoader> loader)58 void HostRecord::scheduleResourceLoader(PassRefPtr<NetworkResourceLoader> loader) 60 59 { 61 60 ASSERT(isMainThread()); … … 69 68 } 70 69 71 void HostRecord::addLoaderInProgress( SchedulableLoader* loader)70 void HostRecord::addLoaderInProgress(NetworkResourceLoader* loader) 72 71 { 73 72 ASSERT(isMainThread()); … … 77 76 } 78 77 79 inline bool removeLoaderFromQueue( SchedulableLoader* loader, LoaderQueue& queue)78 inline bool removeLoaderFromQueue(NetworkResourceLoader* loader, LoaderQueue& queue) 80 79 { 81 80 LoaderQueue::iterator end = queue.end(); … … 90 89 } 91 90 92 void HostRecord::removeLoader( SchedulableLoader* loader)91 void HostRecord::removeLoader(NetworkResourceLoader* loader) 93 92 { 94 93 ASSERT(isMainThread()); … … 97 96 // It would be nice to know the loader has already been removed and treat it as a no-op. 98 97 99 SchedulableLoaderSet::iterator i = m_loadersInProgress.find(loader);98 NetworkResourceLoaderSet::iterator i = m_loadersInProgress.find(loader); 100 99 if (i != m_loadersInProgress.end()) { 101 100 i->get()->setHostRecord(0); … … 161 160 162 161 while (!queue.isEmpty()) { 163 RefPtr< SchedulableLoader> loader = queue.first();162 RefPtr<NetworkResourceLoader> loader = queue.first(); 164 163 ASSERT(loader->hostRecord() == this); 165 164 … … 194 193 } 195 194 196 bool HostRecord::limitsRequests(ResourceLoadPriority priority, SchedulableLoader* loader) const195 bool HostRecord::limitsRequests(ResourceLoadPriority priority, NetworkResourceLoader* loader) const 197 196 { 198 197 ASSERT(loader); … … 214 213 #ifndef NDEBUG 215 214 // If we have more loaders in progress than we should, at least one of them had better be synchronous. 216 SchedulableLoaderSet::iterator i = m_loadersInProgress.begin();217 SchedulableLoaderSet::iterator end = m_loadersInProgress.end();215 NetworkResourceLoaderSet::iterator i = m_loadersInProgress.begin(); 216 NetworkResourceLoaderSet::iterator end = m_loadersInProgress.end(); 218 217 for (; i != end; ++i) { 219 218 if (i->get()->isSynchronous()) -
trunk/Source/WebKit2/NetworkProcess/HostRecord.h
r151795 r154183 38 38 39 39 class NetworkResourceLoader; 40 class SchedulableLoader;41 class SyncNetworkResourceLoader;42 40 43 typedef Deque<RefPtr< SchedulableLoader>> LoaderQueue;41 typedef Deque<RefPtr<NetworkResourceLoader>> LoaderQueue; 44 42 typedef uint64_t ResourceLoadIdentifier; 45 43 … … 55 53 const String& name() const { return m_name; } 56 54 57 void scheduleResourceLoader(PassRefPtr< SchedulableLoader>);58 void addLoaderInProgress( SchedulableLoader*);59 void removeLoader( SchedulableLoader*);55 void scheduleResourceLoader(PassRefPtr<NetworkResourceLoader>); 56 void addLoaderInProgress(NetworkResourceLoader*); 57 void removeLoader(NetworkResourceLoader*); 60 58 bool hasRequests() const; 61 59 void servePendingRequests(WebCore::ResourceLoadPriority); … … 68 66 69 67 void servePendingRequestsForQueue(LoaderQueue&, WebCore::ResourceLoadPriority); 70 bool limitsRequests(WebCore::ResourceLoadPriority, SchedulableLoader*) const;68 bool limitsRequests(WebCore::ResourceLoadPriority, NetworkResourceLoader*) const; 71 69 72 70 LoaderQueue m_loadersPending[WebCore::ResourceLoadPriorityHighest + 1]; 73 71 LoaderQueue m_syncLoadersPending; 74 72 75 typedef HashSet<RefPtr< SchedulableLoader>> SchedulableLoaderSet;76 SchedulableLoaderSet m_loadersInProgress;73 typedef HashSet<RefPtr<NetworkResourceLoader>> NetworkResourceLoaderSet; 74 NetworkResourceLoaderSet m_loadersInProgress; 77 75 78 76 const String m_name; -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
r150609 r154183 36 36 #include "NetworkResourceLoaderMessages.h" 37 37 #include "RemoteNetworkingContext.h" 38 #include "SyncNetworkResourceLoader.h"39 38 #include <WebCore/BlobData.h> 40 39 #include <WebCore/PlatformCookieJar.h> … … 101 100 i->value->abort(); 102 101 103 HashMap<ResourceLoadIdentifier, RefPtr<SyncNetworkResourceLoader>>::iterator syncEnd = m_syncNetworkResourceLoaders.end();104 for (HashMap<ResourceLoadIdentifier, RefPtr<SyncNetworkResourceLoader>>::iterator i = m_syncNetworkResourceLoaders.begin(); i != syncEnd; ++i)105 i->value->abort();106 107 102 NetworkBlobRegistry::shared().connectionToWebProcessDidClose(this); 108 103 … … 125 120 void NetworkConnectionToWebProcess::performSynchronousLoad(const NetworkResourceLoadParameters& loadParameters, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> reply) 126 121 { 127 RefPtr< SyncNetworkResourceLoader> loader = SyncNetworkResourceLoader::create(loadParameters, this, reply);128 m_ syncNetworkResourceLoaders.add(loadParameters.identifier, loader);122 RefPtr<NetworkResourceLoader> loader = NetworkResourceLoader::create(loadParameters, this, reply); 123 m_networkResourceLoaders.add(loadParameters.identifier, loader); 129 124 NetworkProcess::shared().networkResourceLoadScheduler().scheduleLoader(loader.get()); 130 125 } … … 132 127 void NetworkConnectionToWebProcess::removeLoadIdentifier(ResourceLoadIdentifier identifier) 133 128 { 134 RefPtr<SchedulableLoader> loader = m_networkResourceLoaders.take(identifier); 135 if (!loader) 136 loader = m_syncNetworkResourceLoaders.take(identifier); 129 RefPtr<NetworkResourceLoader> loader = m_networkResourceLoaders.take(identifier); 137 130 138 131 // It's possible we have no loader for this identifier if the NetworkProcess crashed and this was a respawned NetworkProcess. -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
r149848 r154183 94 94 95 95 HashMap<ResourceLoadIdentifier, RefPtr<NetworkResourceLoader>> m_networkResourceLoaders; 96 HashMap<ResourceLoadIdentifier, RefPtr<SyncNetworkResourceLoader>> m_syncNetworkResourceLoaders;97 96 98 97 bool m_serialLoadingEnabled; -
trunk/Source/WebKit2/NetworkProcess/NetworkLoaderClient.h
r154182 r154183 24 24 */ 25 25 26 #ifndef SyncNetworkResourceLoader_h27 #define SyncNetworkResourceLoader_h26 #ifndef NetworkLoaderClient_h 27 #define NetworkLoaderClient_h 28 28 29 #include "NetworkConnectionToWebProcessMessages.h"30 #include "SchedulableLoader.h"31 29 #include <wtf/RefCounted.h> 32 30 33 31 #if ENABLE(NETWORK_PROCESS) 34 32 33 namespace WebCore { 34 class ProtectionSpace; 35 class ResourceError; 36 class ResourceRequest; 37 class ResourceResponse; 38 class SharedBuffer; 39 } 40 35 41 namespace WebKit { 36 42 37 class SyncNetworkResourceLoader : public SchedulableLoader { 43 class NetworkResourceLoader; 44 45 class NetworkLoaderClient { 38 46 public: 39 static PassRefPtr<SyncNetworkResourceLoader> create(const NetworkResourceLoadParameters& parameters, NetworkConnectionToWebProcess* connection, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> reply) 40 { 41 return adoptRef(new SyncNetworkResourceLoader(parameters, connection, reply)); 42 } 47 virtual ~NetworkLoaderClient() { } 43 48 44 virtual void start() OVERRIDE; 45 virtual void abort() OVERRIDE; 49 virtual void willSendRequest(NetworkResourceLoader*, WebCore::ResourceRequest& newRequest, const WebCore::ResourceResponse& redirectResponse) = 0; 50 virtual void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader*, const WebCore::ProtectionSpace&) = 0; 51 virtual void didReceiveResponse(NetworkResourceLoader*, const WebCore::ResourceResponse&) = 0; 52 virtual void didReceiveBuffer(NetworkResourceLoader*, WebCore::SharedBuffer*, int encodedDataLength) = 0; 53 virtual void didSendData(NetworkResourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) = 0; 54 virtual void didFinishLoading(NetworkResourceLoader*, double finishTime) = 0; 55 virtual void didFail(NetworkResourceLoader*, const WebCore::ResourceError&) = 0; 46 56 47 virtual bool isSynchronous() OVERRIDE { return true; }57 virtual bool isSynchronous() { return false; } 48 58 49 private: 50 SyncNetworkResourceLoader(const NetworkResourceLoadParameters&, NetworkConnectionToWebProcess*, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>); 51 52 void cleanup(); 53 54 RefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> m_delayedReply; 59 protected: 60 NetworkLoaderClient() { } 55 61 }; 56 62 … … 59 65 #endif // ENABLE(NETWORK_PROCESS) 60 66 61 #endif // SyncNetworkResourceLoader_h67 #endif // NetworkLoaderClient_h -
trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp
r154144 r154183 38 38 #include "NetworkProcessPlatformStrategies.h" 39 39 #include "NetworkProcessProxyMessages.h" 40 #include "NetworkResourceLoader.h" 40 41 #include "RemoteNetworkingContext.h" 41 #include "SchedulableLoader.h"42 42 #include "StatisticsData.h" 43 43 #include "WebContextMessages.h" -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp
r151795 r154183 7 7 #include "NetworkResourceLoadParameters.h" 8 8 #include "NetworkResourceLoader.h" 9 #include "SyncNetworkResourceLoader.h"10 9 #include <wtf/MainThread.h> 11 10 #include <wtf/text/CString.h> … … 38 37 } 39 38 40 void NetworkResourceLoadScheduler::scheduleLoader(PassRefPtr< SchedulableLoader> loader)39 void NetworkResourceLoadScheduler::scheduleLoader(PassRefPtr<NetworkResourceLoader> loader) 41 40 { 42 41 ResourceLoadPriority priority = loader->priority(); … … 76 75 } 77 76 78 void NetworkResourceLoadScheduler::removeLoader( SchedulableLoader* loader)77 void NetworkResourceLoadScheduler::removeLoader(NetworkResourceLoader* loader) 79 78 { 80 79 ASSERT(isMainThread()); … … 94 93 } 95 94 96 void NetworkResourceLoadScheduler::receivedRedirect( SchedulableLoader* loader, const WebCore::KURL& redirectURL)95 void NetworkResourceLoadScheduler::receivedRedirect(NetworkResourceLoader* loader, const WebCore::KURL& redirectURL) 97 96 { 98 97 ASSERT(isMainThread()); … … 149 148 void NetworkResourceLoadScheduler::removeScheduledLoaders() 150 149 { 151 Vector<RefPtr< SchedulableLoader>> loadersToRemove;150 Vector<RefPtr<NetworkResourceLoader>> loadersToRemove; 152 151 { 153 152 MutexLocker locker(m_loadersToRemoveMutex); … … 161 160 } 162 161 163 void NetworkResourceLoadScheduler::scheduleRemoveLoader( SchedulableLoader* loader)162 void NetworkResourceLoadScheduler::scheduleRemoveLoader(NetworkResourceLoader* loader) 164 163 { 165 164 MutexLocker locker(m_loadersToRemoveMutex); -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.h
r151795 r154183 42 42 43 43 class HostRecord; 44 class SchedulableLoader;44 class NetworkResourceLoader; 45 45 46 46 class NetworkResourceLoadScheduler { … … 51 51 52 52 // Adds the request to the queue for its host. 53 void scheduleLoader(PassRefPtr< SchedulableLoader>);53 void scheduleLoader(PassRefPtr<NetworkResourceLoader>); 54 54 55 55 // Called by the WebProcess when a ResourceLoader is being cleaned up. 56 void removeLoader( SchedulableLoader*);56 void removeLoader(NetworkResourceLoader*); 57 57 58 58 // Called within the NetworkProcess on a background thread when a resource load has finished. 59 void scheduleRemoveLoader( SchedulableLoader*);59 void scheduleRemoveLoader(NetworkResourceLoader*); 60 60 61 void receivedRedirect( SchedulableLoader*, const WebCore::KURL& redirectURL);61 void receivedRedirect(NetworkResourceLoader*, const WebCore::KURL& redirectURL); 62 62 void servePendingRequests(WebCore::ResourceLoadPriority = WebCore::ResourceLoadPriorityVeryLow); 63 63 … … 87 87 HostMap m_hosts; 88 88 89 typedef HashSet<RefPtr< SchedulableLoader>> SchedulableLoaderSet;90 SchedulableLoaderSet m_loaders;89 typedef HashSet<RefPtr<NetworkResourceLoader>> NetworkResourceLoaderSet; 90 NetworkResourceLoaderSet m_loaders; 91 91 92 92 RefPtr<HostRecord> m_nonHTTPProtocolHost; … … 97 97 98 98 Mutex m_loadersToRemoveMutex; 99 Vector<RefPtr< SchedulableLoader>> m_loadersToRemove;99 Vector<RefPtr<NetworkResourceLoader>> m_loadersToRemove; 100 100 101 101 unsigned m_maxRequestsInFlightPerHost; -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
r152862 r154183 29 29 #if ENABLE(NETWORK_PROCESS) 30 30 31 #include "AsynchronousNetworkLoaderClient.h" 31 32 #include "AuthenticationManager.h" 32 33 #include "DataReference.h" 33 34 #include "Logging.h" 35 #include "NetworkBlobRegistry.h" 34 36 #include "NetworkConnectionToWebProcess.h" 35 37 #include "NetworkProcess.h" … … 40 42 #include "ShareableResource.h" 41 43 #include "SharedMemory.h" 44 #include "SynchronousNetworkLoaderClient.h" 42 45 #include "WebCoreArgumentCoders.h" 43 46 #include "WebErrors.h" … … 46 49 #include <WebCore/ResourceBuffer.h> 47 50 #include <WebCore/ResourceHandle.h> 48 #include <wtf/CurrentTime.h>49 51 #include <wtf/MainThread.h> 50 52 … … 53 55 namespace WebKit { 54 56 55 NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters& loadParameters, NetworkConnectionToWebProcess* connection) 56 : SchedulableLoader(loadParameters, connection) 57 , m_bytesReceived(0) 57 NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters& parameters, NetworkConnectionToWebProcess* connection, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> reply) 58 : m_bytesReceived(0) 58 59 , m_handleConvertedToDownload(false) 59 { 60 ASSERT(isMainThread()); 60 , m_identifier(parameters.identifier) 61 , m_webPageID(parameters.webPageID) 62 , m_webFrameID(parameters.webFrameID) 63 , m_request(parameters.request) 64 , m_priority(parameters.priority) 65 , m_contentSniffingPolicy(parameters.contentSniffingPolicy) 66 , m_allowStoredCredentials(parameters.allowStoredCredentials) 67 , m_clientCredentialPolicy(parameters.clientCredentialPolicy) 68 , m_inPrivateBrowsingMode(parameters.inPrivateBrowsingMode) 69 , m_shouldClearReferrerOnHTTPSToHTTPRedirect(parameters.shouldClearReferrerOnHTTPSToHTTPRedirect) 70 , m_isLoadingMainResource(parameters.isMainResource) 71 , m_sandboxExtensionsAreConsumed(false) 72 , m_connection(connection) 73 { 74 // Either this loader has both a webPageID and webFrameID, or it is not allowed to ask the client for authentication credentials. 75 // FIXME: This is necessary because of the existence of EmptyFrameLoaderClient in WebCore. 76 // Once bug 116233 is resolved, this ASSERT can just be "m_webPageID && m_webFrameID" 77 ASSERT((m_webPageID && m_webFrameID) || m_clientCredentialPolicy == DoNotAskClientForAnyCredentials); 78 79 for (size_t i = 0, count = parameters.requestBodySandboxExtensions.size(); i < count; ++i) { 80 if (RefPtr<SandboxExtension> extension = SandboxExtension::create(parameters.requestBodySandboxExtensions[i])) 81 m_requestBodySandboxExtensions.append(extension); 82 } 83 84 #if ENABLE(BLOB) 85 if (m_request.httpBody()) { 86 const Vector<FormDataElement>& elements = m_request.httpBody()->elements(); 87 for (size_t i = 0, count = elements.size(); i < count; ++i) { 88 if (elements[i].m_type == FormDataElement::encodedBlob) { 89 Vector<RefPtr<SandboxExtension>> blobElementExtensions = NetworkBlobRegistry::shared().sandboxExtensions(elements[i].m_url); 90 m_requestBodySandboxExtensions.appendVector(blobElementExtensions); 91 } 92 } 93 } 94 95 if (m_request.url().protocolIs("blob")) { 96 ASSERT(!SandboxExtension::create(parameters.resourceSandboxExtension)); 97 m_resourceSandboxExtensions = NetworkBlobRegistry::shared().sandboxExtensions(m_request.url()); 98 } else 99 #endif 100 if (RefPtr<SandboxExtension> resourceSandboxExtension = SandboxExtension::create(parameters.resourceSandboxExtension)) 101 m_resourceSandboxExtensions.append(resourceSandboxExtension); 102 103 ASSERT(isMainThread()); 104 105 if (reply) 106 m_networkLoaderClient = SynchronousNetworkLoaderClient::create(m_request, reply); 107 else 108 m_networkLoaderClient = AsynchronousNetworkLoaderClient::create(); 61 109 } 62 110 … … 65 113 ASSERT(isMainThread()); 66 114 ASSERT(!m_handle); 115 ASSERT(!m_hostRecord); 116 } 117 118 bool NetworkResourceLoader::isSynchronous() const 119 { 120 return m_networkLoaderClient->isSynchronous(); 67 121 } 68 122 … … 75 129 76 130 // FIXME (NetworkProcess): Create RemoteNetworkingContext with actual settings. 77 m_networkingContext = RemoteNetworkingContext::create(false, false, inPrivateBrowsingMode(), shouldClearReferrerOnHTTPSToHTTPRedirect());131 m_networkingContext = RemoteNetworkingContext::create(false, false, m_inPrivateBrowsingMode, m_shouldClearReferrerOnHTTPSToHTTPRedirect); 78 132 79 133 consumeSandboxExtensions(); 80 134 81 135 // FIXME (NetworkProcess): Pass an actual value for defersLoading 82 m_handle = ResourceHandle::create(m_networkingContext.get(), request(), this, false /* defersLoading */, contentSniffingPolicy()== SniffContent);136 m_handle = ResourceHandle::create(m_networkingContext.get(), m_request, this, false /* defersLoading */, m_contentSniffingPolicy == SniffContent); 83 137 } 84 138 … … 103 157 } 104 158 105 template<typename U> bool NetworkResourceLoader::sendAbortingOnFailure(const U& message, unsigned messageSendFlags)106 {107 bool result = messageSenderConnection()->send(message, messageSenderDestinationID(), messageSendFlags);108 if (!result)109 abort();110 return result;111 }112 113 159 void NetworkResourceLoader::didConvertHandleToDownload() 114 160 { … … 135 181 formData->removeGeneratedFilesIfNeeded(); 136 182 137 sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveResponseWithCertificateInfo(response, PlatformCertificateInfo(response), isLoadingMainResource()));183 m_networkLoaderClient->didReceiveResponse(this, response); 138 184 139 185 // m_handle will be 0 if the request got aborted above. … … 141 187 return; 142 188 143 if (! isLoadingMainResource()) {189 if (!m_isLoadingMainResource) { 144 190 // For main resources, the web process is responsible for sending back a NetworkResourceLoader::ContinueDidReceiveResponse message. 145 191 m_handle->continueDidReceiveResponse(); … … 162 208 163 209 m_bytesReceived += buffer->size(); 164 165 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 166 ShareableResource::Handle shareableResourceHandle; 167 tryGetShareableHandleFromSharedBuffer(shareableResourceHandle, buffer.get()); 168 if (!shareableResourceHandle.isNull()) { 169 // Since we're delivering this resource by ourselves all at once, we'll abort the resource handle since we don't need anymore callbacks from ResourceHandle. 170 abort(); 171 send(Messages::WebResourceLoader::DidReceiveResource(shareableResourceHandle, currentTime())); 172 return; 173 } 174 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 175 176 CoreIPC::DataReference dataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size()); 177 sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedDataLength)); 210 m_networkLoaderClient->didReceiveBuffer(this, buffer.get(), encodedDataLength); 178 211 } 179 212 … … 182 215 ASSERT_UNUSED(handle, handle == m_handle); 183 216 184 // FIXME (NetworkProcess): For the memory cache we'll need to update the finished status of the cached resource here. 185 // Such bookkeeping will need to be thread safe, as this callback is happening on a background thread. 186 send(Messages::WebResourceLoader::DidFinishResourceLoad(finishTime)); 187 217 m_networkLoaderClient->didFinishLoading(this, finishTime); 218 188 219 cleanup(); 189 220 } … … 193 224 ASSERT_UNUSED(handle, handle == m_handle); 194 225 195 // FIXME (NetworkProcess): For the memory cache we'll need to update the finished status of the cached resource here. 196 // Such bookkeeping will need to be thread safe, as this callback is happening on a background thread. 197 send(Messages::WebResourceLoader::DidFailResourceLoad(error)); 226 m_networkLoaderClient->didFail(this, error); 227 198 228 cleanup(); 199 229 } … … 207 237 ASSERT(isMainThread()); 208 238 239 ResourceRequest proposedRequest = request; 209 240 m_suggestedRequestForWillSendRequest = request; 210 241 211 // This message is DispatchMessageEvenWhenWaitingForSyncReply to avoid a situation where the NetworkProcess is deadlocked waiting for 6 connections 212 // to complete while the WebProcess is waiting for a 7th to complete. 213 sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse), CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply); 242 m_networkLoaderClient->willSendRequest(this, proposedRequest, redirectResponse); 214 243 } 215 244 … … 219 248 220 249 RunLoop::main()->dispatch(bind(&NetworkResourceLoadScheduler::receivedRedirect, &NetworkProcess::shared().networkResourceLoadScheduler(), this, m_suggestedRequestForWillSendRequest.url())); 221 m_handle->continueWillSendRequest(m_suggestedRequestForWillSendRequest); 222 250 251 m_request = m_suggestedRequestForWillSendRequest; 223 252 m_suggestedRequestForWillSendRequest = ResourceRequest(); 253 254 m_handle->continueWillSendRequest(m_request); 255 256 if (m_request.isNull()) { 257 m_handle->cancel(); 258 didFail(m_handle.get(), cancelledError(m_request)); 259 } 224 260 } 225 261 … … 238 274 ASSERT_UNUSED(handle, handle == m_handle); 239 275 240 send(Messages::WebResourceLoader::DidSendData(bytesSent, totalBytesToBeSent));276 m_networkLoaderClient->didSendData(this, bytesSent, totalBytesToBeSent); 241 277 } 242 278 … … 264 300 // We still need this sync version, because ResourceHandle itself uses it internally, even when the delegate uses an async one. 265 301 266 return allowStoredCredentials()== AllowStoredCredentials;302 return m_allowStoredCredentials == AllowStoredCredentials; 267 303 } 268 304 … … 281 317 // cross-origin check before asking the client for credentials. 282 318 // Therefore we are too permissive in the case where the ClientCredentialPolicy is DoNotAskClientForCrossOriginCredentials. 283 if ( clientCredentialPolicy()== DoNotAskClientForAnyCredentials) {319 if (m_clientCredentialPolicy == DoNotAskClientForAnyCredentials) { 284 320 challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge); 285 321 return; 286 322 } 287 323 288 NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge( webPageID(), webFrameID(), challenge);324 NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(m_webPageID, m_webFrameID, challenge); 289 325 } 290 326 … … 302 338 } 303 339 304 uint64_t NetworkResourceLoader::messageSenderDestinationID() 305 { 306 return identifier(); 340 void NetworkResourceLoader::consumeSandboxExtensions() 341 { 342 for (size_t i = 0, count = m_requestBodySandboxExtensions.size(); i < count; ++i) 343 m_requestBodySandboxExtensions[i]->consume(); 344 345 for (size_t i = 0, count = m_resourceSandboxExtensions.size(); i < count; ++i) 346 m_resourceSandboxExtensions[i]->consume(); 347 348 m_sandboxExtensionsAreConsumed = true; 349 } 350 351 void NetworkResourceLoader::invalidateSandboxExtensions() 352 { 353 if (m_sandboxExtensionsAreConsumed) { 354 for (size_t i = 0, count = m_requestBodySandboxExtensions.size(); i < count; ++i) 355 m_requestBodySandboxExtensions[i]->revoke(); 356 for (size_t i = 0, count = m_resourceSandboxExtensions.size(); i < count; ++i) 357 m_resourceSandboxExtensions[i]->revoke(); 358 } 359 360 m_requestBodySandboxExtensions.clear(); 361 m_resourceSandboxExtensions.clear(); 362 363 m_sandboxExtensionsAreConsumed = false; 307 364 } 308 365 … … 313 370 ASSERT_UNUSED(handle, handle == m_handle); 314 371 315 // This message is DispatchMessageEvenWhenWaitingForSyncReply to avoid a situation where the NetworkProcess is deadlocked 316 // waiting for 6 connections to complete while the WebProcess is waiting for a 7th to complete. 317 sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace), CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply); 372 m_networkLoaderClient->canAuthenticateAgainstProtectionSpace(this, protectionSpace); 318 373 } 319 374 -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h
r150669 r154183 29 29 #if ENABLE(NETWORK_PROCESS) 30 30 31 #include "HostRecord.h" 31 32 #include "MessageSender.h" 32 #include " SchedulableLoader.h"33 #include "NetworkConnectionToWebProcessMessages.h" 33 34 #include "ShareableResource.h" 34 35 #include <WebCore/ResourceHandleClient.h> 36 #include <WebCore/ResourceLoaderOptions.h> 37 #include <WebCore/ResourceRequest.h> 35 38 #include <WebCore/RunLoop.h> 39 #include <wtf/MainThread.h> 36 40 37 41 typedef const struct _CFCachedURLResponse* CFCachedURLResponseRef; … … 46 50 47 51 class NetworkConnectionToWebProcess; 52 class NetworkLoaderClient; 53 class NetworkResourceLoadParameters; 48 54 class RemoteNetworkingContext; 55 class SandboxExtension; 49 56 50 class NetworkResourceLoader : public SchedulableLoader, public WebCore::ResourceHandleClient, public CoreIPC::MessageSender {57 class NetworkResourceLoader : public RefCounted<NetworkResourceLoader>, public WebCore::ResourceHandleClient, public CoreIPC::MessageSender { 51 58 public: 52 59 static RefPtr<NetworkResourceLoader> create(const NetworkResourceLoadParameters& parameters, NetworkConnectionToWebProcess* connection) 53 60 { 54 return adoptRef(new NetworkResourceLoader(parameters, connection ));61 return adoptRef(new NetworkResourceLoader(parameters, connection, nullptr)); 55 62 } 56 63 64 static RefPtr<NetworkResourceLoader> create(const NetworkResourceLoadParameters& parameters, NetworkConnectionToWebProcess* connection, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> reply) 65 { 66 return adoptRef(new NetworkResourceLoader(parameters, connection, reply)); 67 } 57 68 ~NetworkResourceLoader(); 69 70 NetworkConnectionToWebProcess* connectionToWebProcess() const { return m_connection.get(); } 71 72 WebCore::ResourceLoadPriority priority() { return m_priority; } 73 WebCore::ResourceRequest& request() { return m_request; } 58 74 59 75 WebCore::ResourceHandle* handle() const { return m_handle.get(); } 60 76 void didConvertHandleToDownload(); 61 77 62 v irtual void start() OVERRIDE;63 v irtual void abort() OVERRIDE;78 void start(); 79 void abort(); 64 80 65 81 // ResourceHandleClient methods … … 101 117 #endif 102 118 119 bool isSynchronous() const; 120 bool isLoadingMainResource() const { return m_isLoadingMainResource; } 121 122 void setHostRecord(HostRecord* hostRecord) { ASSERT(isMainThread()); m_hostRecord = hostRecord; } 123 HostRecord* hostRecord() const { ASSERT(isMainThread()); return m_hostRecord.get(); } 124 125 template<typename U> bool sendAbortingOnFailure(const U& message, unsigned messageSendFlags = 0) 126 { 127 bool result = messageSenderConnection()->send(message, messageSenderDestinationID(), messageSendFlags); 128 if (!result) 129 abort(); 130 return result; 131 } 132 133 134 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 135 void continueCanAuthenticateAgainstProtectionSpace(bool); 136 #endif 137 void continueWillSendRequest(const WebCore::ResourceRequest& newRequest); 138 139 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 140 static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&, WebCore::SharedBuffer*); 141 #endif 142 103 143 private: 104 NetworkResourceLoader(const NetworkResourceLoadParameters&, NetworkConnectionToWebProcess* );144 NetworkResourceLoader(const NetworkResourceLoadParameters&, NetworkConnectionToWebProcess*, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>); 105 145 106 146 // CoreIPC::MessageSender 107 147 virtual CoreIPC::Connection* messageSenderConnection() OVERRIDE; 108 virtual uint64_t messageSenderDestinationID() OVERRIDE ;148 virtual uint64_t messageSenderDestinationID() OVERRIDE { return m_identifier; } 109 149 110 void continueWillSendRequest(const WebCore::ResourceRequest& newRequest);111 150 void continueDidReceiveResponse(); 112 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)113 void continueCanAuthenticateAgainstProtectionSpace(bool);114 #endif115 151 116 152 void cleanup(); … … 118 154 void platformDidReceiveResponse(const WebCore::ResourceResponse&); 119 155 120 template<typename U> bool sendAbortingOnFailure(const U& message, unsigned messageSendFlags = 0); 156 void consumeSandboxExtensions(); 157 void invalidateSandboxExtensions(); 121 158 122 159 RefPtr<RemoteNetworkingContext> m_networkingContext; … … 129 166 130 167 bool m_handleConvertedToDownload; 168 OwnPtr<NetworkLoaderClient> m_networkLoaderClient; 131 169 132 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 133 static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&, WebCore::SharedBuffer*); 134 #endif 170 ResourceLoadIdentifier m_identifier; 171 uint64_t m_webPageID; 172 uint64_t m_webFrameID; 173 WebCore::ResourceRequest m_request; 174 WebCore::ResourceLoadPriority m_priority; 175 WebCore::ContentSniffingPolicy m_contentSniffingPolicy; 176 WebCore::StoredCredentials m_allowStoredCredentials; 177 WebCore::ClientCredentialPolicy m_clientCredentialPolicy; 178 bool m_inPrivateBrowsingMode; 179 bool m_shouldClearReferrerOnHTTPSToHTTPRedirect; 180 bool m_isLoadingMainResource; 181 182 Vector<RefPtr<SandboxExtension>> m_requestBodySandboxExtensions; 183 Vector<RefPtr<SandboxExtension>> m_resourceSandboxExtensions; 184 bool m_sandboxExtensionsAreConsumed; 185 186 RefPtr<NetworkConnectionToWebProcess> m_connection; 187 188 RefPtr<HostRecord> m_hostRecord; 135 189 }; 136 190 -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r153693 r154183 490 490 517CF0E3163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517CF0E1163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp */; }; 491 491 517CF0E4163A486C00C2950E /* NetworkProcessConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 517CF0E2163A486C00C2950E /* NetworkProcessConnectionMessages.h */; }; 492 51815B9F16A622210054501F /* SyncNetworkResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51815B9D16A622210054501F /* SyncNetworkResourceLoader.cpp */; };493 51815BA016A622210054501F /* SyncNetworkResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 51815B9E16A622210054501F /* SyncNetworkResourceLoader.h */; };494 492 51829DA51637C70C000953D6 /* NetworkResourceLoadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51829DA31637C70C000953D6 /* NetworkResourceLoadScheduler.cpp */; }; 495 493 51829DA61637C70C000953D6 /* NetworkResourceLoadScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 51829DA41637C70C000953D6 /* NetworkResourceLoadScheduler.h */; }; … … 515 513 518E8F0C16B2093700E91429 /* DownloadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 518E8F0316B2093700E91429 /* DownloadManager.h */; }; 516 514 518E8F0D16B2093700E91429 /* DownloadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 518E8F0516B2093700E91429 /* DownloadMac.mm */; }; 517 519B4FF416A9EA970066874D /* SchedulableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519B4FF216A9EA970066874D /* SchedulableLoader.cpp */; };518 519B4FF516A9EA970066874D /* SchedulableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 519B4FF316A9EA970066874D /* SchedulableLoader.h */; };519 515 51A4D5A916CAC4FF000E615E /* StatisticsRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A4D5A816CAC4FF000E615E /* StatisticsRequest.cpp */; }; 520 516 51A555F5128C6C47009ABCEC /* WKContextMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A555F3128C6C47009ABCEC /* WKContextMenuItem.cpp */; }; … … 556 552 51FA2D7715212E2600C1BA0B /* WKBundleDOMWindowExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FA2D7515212E1E00C1BA0B /* WKBundleDOMWindowExtension.cpp */; }; 557 553 51FB08FF1639DE1A00EC324A /* WebResourceLoadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABF65616392F1500132A7A /* WebResourceLoadScheduler.cpp */; }; 554 51FCB18517BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCB18017BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp */; }; 555 51FCB18617BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FCB18117BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h */; }; 556 51FCB18717BBFE0300394CD8 /* NetworkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FCB18217BBFE0300394CD8 /* NetworkLoaderClient.h */; }; 557 51FCB18817BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCB18317BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp */; }; 558 51FCB18917BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FCB18417BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h */; }; 558 559 51FD18B51651FBAD00DBE1CE /* NetworkResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FD18B31651FBAD00DBE1CE /* NetworkResourceLoader.cpp */; }; 559 560 51FD18B61651FBAD00DBE1CE /* NetworkResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FD18B41651FBAD00DBE1CE /* NetworkResourceLoader.h */; }; … … 1960 1961 517CF0E1163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkProcessConnectionMessageReceiver.cpp; sourceTree = "<group>"; }; 1961 1962 517CF0E2163A486C00C2950E /* NetworkProcessConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkProcessConnectionMessages.h; sourceTree = "<group>"; }; 1962 51815B9D16A622210054501F /* SyncNetworkResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SyncNetworkResourceLoader.cpp; path = NetworkProcess/SyncNetworkResourceLoader.cpp; sourceTree = "<group>"; };1963 51815B9E16A622210054501F /* SyncNetworkResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SyncNetworkResourceLoader.h; path = NetworkProcess/SyncNetworkResourceLoader.h; sourceTree = "<group>"; };1964 1963 51829DA31637C70C000953D6 /* NetworkResourceLoadScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkResourceLoadScheduler.cpp; path = NetworkProcess/NetworkResourceLoadScheduler.cpp; sourceTree = "<group>"; }; 1965 1964 51829DA41637C70C000953D6 /* NetworkResourceLoadScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkResourceLoadScheduler.h; path = NetworkProcess/NetworkResourceLoadScheduler.h; sourceTree = "<group>"; }; … … 1987 1986 518E8F0316B2093700E91429 /* DownloadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DownloadManager.h; path = Downloads/DownloadManager.h; sourceTree = "<group>"; }; 1988 1987 518E8F0516B2093700E91429 /* DownloadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadMac.mm; sourceTree = "<group>"; }; 1989 519B4FF216A9EA970066874D /* SchedulableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SchedulableLoader.cpp; path = NetworkProcess/SchedulableLoader.cpp; sourceTree = "<group>"; };1990 519B4FF316A9EA970066874D /* SchedulableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SchedulableLoader.h; path = NetworkProcess/SchedulableLoader.h; sourceTree = "<group>"; };1991 1988 51A4D5A816CAC4FF000E615E /* StatisticsRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatisticsRequest.cpp; sourceTree = "<group>"; }; 1992 1989 51A555F3128C6C47009ABCEC /* WKContextMenuItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKContextMenuItem.cpp; sourceTree = "<group>"; }; … … 2037 2034 51FA2D7515212E1E00C1BA0B /* WKBundleDOMWindowExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleDOMWindowExtension.cpp; sourceTree = "<group>"; }; 2038 2035 51FB0902163A3B1C00EC324A /* NetworkProcessConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = NetworkProcessConnection.messages.in; path = Network/NetworkProcessConnection.messages.in; sourceTree = "<group>"; }; 2036 51FCB18017BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AsynchronousNetworkLoaderClient.cpp; path = NetworkProcess/AsynchronousNetworkLoaderClient.cpp; sourceTree = "<group>"; }; 2037 51FCB18117BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsynchronousNetworkLoaderClient.h; path = NetworkProcess/AsynchronousNetworkLoaderClient.h; sourceTree = "<group>"; }; 2038 51FCB18217BBFE0300394CD8 /* NetworkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkLoaderClient.h; path = NetworkProcess/NetworkLoaderClient.h; sourceTree = "<group>"; }; 2039 51FCB18317BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SynchronousNetworkLoaderClient.cpp; path = NetworkProcess/SynchronousNetworkLoaderClient.cpp; sourceTree = "<group>"; }; 2040 51FCB18417BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SynchronousNetworkLoaderClient.h; path = NetworkProcess/SynchronousNetworkLoaderClient.h; sourceTree = "<group>"; }; 2039 2041 51FD18B31651FBAD00DBE1CE /* NetworkResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkResourceLoader.cpp; path = NetworkProcess/NetworkResourceLoader.cpp; sourceTree = "<group>"; }; 2040 2042 51FD18B41651FBAD00DBE1CE /* NetworkResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkResourceLoader.h; path = NetworkProcess/NetworkResourceLoader.h; sourceTree = "<group>"; }; … … 3639 3641 E1798C7616E6815500240139 /* FileAPI */, 3640 3642 510CC7DC16138E2900D03ED3 /* mac */, 3643 51FCB18017BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp */, 3644 51FCB18117BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h */, 3641 3645 512C06861638F67E00ABB911 /* HostRecord.cpp */, 3642 3646 512C06871638F67E00ABB911 /* HostRecord.h */, … … 3644 3648 513A164A1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h */, 3645 3649 513A164B1630A9BF005D7D22 /* NetworkConnectionToWebProcess.messages.in */, 3650 51FCB18217BBFE0300394CD8 /* NetworkLoaderClient.h */, 3646 3651 510CC7DF16138E2900D03ED3 /* NetworkProcess.cpp */, 3647 3652 510CC7E016138E2900D03ED3 /* NetworkProcess.h */, … … 3654 3659 51829DA31637C70C000953D6 /* NetworkResourceLoadScheduler.cpp */, 3655 3660 51829DA41637C70C000953D6 /* NetworkResourceLoadScheduler.h */, 3656 519B4FF216A9EA970066874D /* SchedulableLoader.cpp */, 3657 519B4FF316A9EA970066874D /* SchedulableLoader.h */, 3658 51815B9D16A622210054501F /* SyncNetworkResourceLoader.cpp */, 3659 51815B9E16A622210054501F /* SyncNetworkResourceLoader.h */, 3661 51FCB18317BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp */, 3662 51FCB18417BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h */, 3660 3663 ); 3661 3664 name = NetworkProcess; … … 5399 5402 1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */, 5400 5403 1A232903162C867300D82F7A /* MessageDecoder.h in Headers */, 5404 51FCB18617BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h in Headers */, 5401 5405 1A2328FF162C866A00D82F7A /* MessageEncoder.h in Headers */, 5402 5406 1AC4C82916B876A90069DCCD /* MessageFlags.h in Headers */, … … 5450 5454 C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */, 5451 5455 E19582D3153CBFD700B60875 /* PDFKitImports.h in Headers */, 5456 51FCB18917BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h in Headers */, 5452 5457 BCF505E71243047B005955AE /* PlatformCertificateInfo.h in Headers */, 5453 5458 BCC43ABB127B95DC00317F16 /* PlatformPopupMenuData.h in Headers */, … … 5494 5499 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */, 5495 5500 E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */, 5496 519B4FF516A9EA970066874D /* SchedulableLoader.h in Headers */,5497 5501 51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */, 5498 5502 51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */, … … 5521 5525 1A13BEB41635A9C800F19C03 /* StringReference.h in Headers */, 5522 5526 296BD85D15019BC30071F424 /* StringUtilities.h in Headers */, 5523 51815BA016A622210054501F /* SyncNetworkResourceLoader.h in Headers */,5524 5527 1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */, 5525 5528 1QQ417CB12C00CCA002BE67B /* TextCheckerCompletion.h in Headers */, … … 5796 5799 BCE17B7E1381F1170012A641 /* WKPagePrivateMac.h in Headers */, 5797 5800 A5EFD38C16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h in Headers */, 5801 51FCB18717BBFE0300394CD8 /* NetworkLoaderClient.h in Headers */, 5798 5802 7C135AA9173B0BCA00586AE2 /* WKPluginInformation.h in Headers */, 5799 5803 1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */, … … 6762 6766 1AAB4AAA1296F1540023952F /* SandboxExtensionMac.mm in Sources */, 6763 6767 E1E552C416AE065F004ED653 /* SandboxInitialiationParametersMac.mm in Sources */, 6764 519B4FF416A9EA970066874D /* SchedulableLoader.cpp in Sources */,6765 6768 51D130531382EAC000351EDD /* SecItemRequestData.cpp in Sources */, 6766 6769 51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */, … … 6795 6798 1A13BEB31635A9C800F19C03 /* StringReference.cpp in Sources */, 6796 6799 296BD85E15019BC30071F424 /* StringUtilities.mm in Sources */, 6797 51815B9F16A622210054501F /* SyncNetworkResourceLoader.cpp in Sources */,6798 6800 1ZZ417EF12C00D87002BE67B /* TextCheckerCompletion.cpp in Sources */, 6799 6801 1AA417EF12C00D87002BE67B /* TextCheckerMac.mm in Sources */, … … 6981 6983 BC90A1D7122DD66A00CC8C50 /* WebURLResponseMac.mm in Sources */, 6982 6984 C0337DD1127A2980008FF4F4 /* WebWheelEvent.cpp in Sources */, 6985 51FCB18517BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp in Sources */, 6983 6986 29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObject.mm in Sources */, 6984 6987 512E34E4130B4D0500ABD19A /* WKApplicationCacheManager.cpp in Sources */, … … 7059 7062 BC85806312B8505700EDEB2E /* WKOpenPanelParameters.cpp in Sources */, 7060 7063 BC85806212B8505700EDEB2E /* WKOpenPanelResultListener.cpp in Sources */, 7064 51FCB18817BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp in Sources */, 7061 7065 BCD597D6112B56DC00EC8C23 /* WKPage.cpp in Sources */, 7062 7066 BC7B633812A45ABA00D174A4 /* WKPageGroup.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.