NetworkResourceLoader cleanups
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Sep 2014 16:35:00 +0000 (16:35 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Sep 2014 16:35:00 +0000 (16:35 +0000)
commit86fd08b2e5e17ece5f36894e662e8bd666764b5e
tree73c9b30fc265df38d1099e73aa0bf490fd6e0cc9
parent92290993adce02ac50f70f7f7fdbb88af75f3726
NetworkResourceLoader cleanups
https://bugs.webkit.org/show_bug.cgi?id=136701

Reviewed by Darin Adler.

After smashing NetworkResourceLoader together with the clients it can be made nicer.

* NetworkProcess/NetworkResourceLoadScheduler.cpp:
(WebKit::NetworkResourceLoadScheduler::scheduleLoader):
(WebKit::NetworkResourceLoadScheduler::removeLoader):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):

    The original request is now part of the loader.

(WebKit::sendReplyToSynchronousRequest):
(WebKit::NetworkResourceLoader::NetworkResourceLoader):

    Instead of copying everything out from NetworkResourceLoadParameters just include the whole thing as a const field.
    SanboxExtension construction moves to NetworkResourceLoadParameters::decode()
    Stuff that is related to starting the load moves to start().

(WebKit::NetworkResourceLoader::~NetworkResourceLoader):
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::setDefersLoading):

    Eliminate m_deferredRequest since we now always remember the original request.

(WebKit::NetworkResourceLoader::cleanup):
(WebKit::NetworkResourceLoader::didConvertHandleToDownload):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didReceiveResponseAsync):
(WebKit::NetworkResourceLoader::didFail):
(WebKit::NetworkResourceLoader::willSendRequestAsync):
(WebKit::NetworkResourceLoader::continueWillSendRequest):

    Eliminate unnecessary m_suggestedRequestForWillSendRequest.

(WebKit::NetworkResourceLoader::wasBlocked):
(WebKit::NetworkResourceLoader::cannotShowURL):
(WebKit::NetworkResourceLoader::shouldUseCredentialStorage):
(WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge):
(WebKit::NetworkResourceLoader::receivedCancellation):
(WebKit::NetworkResourceLoader::startBufferingTimerIfNeeded):
(WebKit::NetworkResourceLoader::consumeSandboxExtensions):
(WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
(WebKit::NetworkResourceLoader::sendAbortingOnFailure):
* NetworkProcess/NetworkResourceLoader.h:
(WebKit::NetworkResourceLoader::originalRequest):
(WebKit::NetworkResourceLoader::currentRequest):
(WebKit::NetworkResourceLoader::sessionID):
(WebKit::NetworkResourceLoader::defersLoading):
(WebKit::NetworkResourceLoader::isLoadingMainResource):
(WebKit::NetworkResourceLoader::request): Deleted.
(WebKit::NetworkResourceLoader::sendAbortingOnFailure): Deleted.

    Made private and moved to cpp.

* NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
(WebKit::NetworkDiskCacheMonitor::NetworkDiskCacheMonitor):

    Use original request instead of the current one. This might fix a bug where we didn't use file backing over redirects.

* Shared/Network/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::decode):

    Decode to SanboxExtensions to the actual type rather than a handle.

* Shared/Network/NetworkResourceLoadParameters.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/NetworkResourceLoader.h
Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm
Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp
Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h