Remove setDefersLoading infrastructure from WebKit2
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 21:49:39 +0000 (21:49 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 21:49:39 +0000 (21:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194506

Reviewed by Brady Eidson.

Source/WebCore:

setDefersLoading is inherently racy from WebCore to the NetworkProcess,
it adds unwanted complexity to the initialization and use of network objects,
and it has led to many unrecoverable hang bugs over the years.
We needed to force it into WebKit2 to transition some existing clients who relied on it,
but we have recently finished transitioning those clients to other solutions, mostly
completion handlers.

* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::suspend): Deleted.
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::initialize):
(WebKit::NetworkLoad::setDefersLoading): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::setDefersLoading): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::suspend): Deleted.
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::suspend): Deleted.
* NetworkProcess/curl/NetworkDataTaskCurl.h:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::suspend): Deleted.
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::setDefersLoading):

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setDefersLoading): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241317 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/inspector/PageScriptDebugServer.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit/NetworkProcess/NetworkDataTask.h
Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp
Source/WebKit/NetworkProcess/NetworkDataTaskBlob.h
Source/WebKit/NetworkProcess/NetworkLoad.cpp
Source/WebKit/NetworkProcess/NetworkLoad.h
Source/WebKit/NetworkProcess/NetworkLoadParameters.h
Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/NetworkProcess/NetworkResourceLoader.h
Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h
Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp
Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h
Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.h
Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

index fcc4fba..5c9e534 100644 (file)
@@ -1,3 +1,12 @@
+2019-02-12  Alex Christensen  <achristensen@webkit.org>
+
+        Remove setDefersLoading infrastructure from WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=194506
+
+        Reviewed by Brady Eidson.
+
+        * platform/wk2/TestExpectations:
+
 2019-02-12  Justin Fan  <justin_fan@apple.com>
 
         [Web GPU] DepthStencilAttachment implementation
index a8227f6..5e47d7c 100644 (file)
@@ -536,7 +536,9 @@ platform/mac/fast/AppleScript/array.html
 platform/mac/fast/AppleScript/date.html
 
 # setDefersLoading is not supported in WK2.
-loader/load-defer.html [ WontFix ]
+loader/load-defer.html [ Skip ]
+loader/load-defer-resume-crash.html [ Skip ]
+loader/navigation-while-deferring-loads.html [ Skip ]
 
 # WebKitTestRunner doesn't have objCController
 platform/mac/fast/dom/objc-wrapper-identity.html
index ffc6e30..8907311 100644 (file)
@@ -1,3 +1,20 @@
+2019-02-12  Alex Christensen  <achristensen@webkit.org>
+
+        Remove setDefersLoading infrastructure from WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=194506
+
+        Reviewed by Brady Eidson.
+
+        setDefersLoading is inherently racy from WebCore to the NetworkProcess,
+        it adds unwanted complexity to the initialization and use of network objects,
+        and it has led to many unrecoverable hang bugs over the years.
+        We needed to force it into WebKit2 to transition some existing clients who relied on it,
+        but we have recently finished transitioning those clients to other solutions, mostly
+        completion handlers.
+
+        * inspector/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::setJavaScriptPaused):
+
 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Unreviewed, fix build warnings after content extensions enablement
index 9c358d3..55d6619 100644 (file)
@@ -138,8 +138,6 @@ void PageScriptDebugServer::setJavaScriptPaused(const PageGroup& pageGroup, bool
     setMainThreadCallbacksPaused(paused);
 
     for (auto& page : pageGroup.pages()) {
-        page->setDefersLoading(paused);
-
         for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext())
             setJavaScriptPaused(*frame, paused);
 
index f7329f5..6a3f7ca 100644 (file)
@@ -1,3 +1,44 @@
+2019-02-12  Alex Christensen  <achristensen@webkit.org>
+
+        Remove setDefersLoading infrastructure from WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=194506
+
+        Reviewed by Brady Eidson.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted.
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        * NetworkProcess/NetworkDataTask.h:
+        * NetworkProcess/NetworkDataTaskBlob.cpp:
+        (WebKit::NetworkDataTaskBlob::suspend): Deleted.
+        * NetworkProcess/NetworkDataTaskBlob.h:
+        * NetworkProcess/NetworkLoad.cpp:
+        (WebKit::NetworkLoad::initialize):
+        (WebKit::NetworkLoad::setDefersLoading): Deleted.
+        * NetworkProcess/NetworkLoad.h:
+        * NetworkProcess/NetworkLoadParameters.h:
+        * NetworkProcess/NetworkResourceLoadParameters.cpp:
+        (WebKit::NetworkResourceLoadParameters::encode const):
+        (WebKit::NetworkResourceLoadParameters::decode):
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::start):
+        (WebKit::NetworkResourceLoader::startNetworkLoad):
+        (WebKit::NetworkResourceLoader::setDefersLoading): Deleted.
+        * NetworkProcess/NetworkResourceLoader.h:
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::NetworkDataTaskCocoa::suspend): Deleted.
+        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
+        (WebKit::NetworkDataTaskCurl::suspend): Deleted.
+        * NetworkProcess/curl/NetworkDataTaskCurl.h:
+        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+        (WebKit::NetworkDataTaskSoup::suspend): Deleted.
+        * NetworkProcess/soup/NetworkDataTaskSoup.h:
+        * WebProcess/Network/WebLoaderStrategy.cpp:
+        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
+        (WebKit::WebLoaderStrategy::setDefersLoading):
+
 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Unreviewed, fix build warnings after content extensions enablement
index b4d7cb4..3df43c4 100644 (file)
@@ -386,18 +386,6 @@ void NetworkConnectionToWebProcess::pageLoadCompleted(uint64_t webPageID)
     stopAllNetworkActivityTrackingForPage(webPageID);
 }
 
-void NetworkConnectionToWebProcess::setDefersLoading(ResourceLoadIdentifier identifier, bool defers)
-{
-    RELEASE_ASSERT(identifier);
-    RELEASE_ASSERT(RunLoop::isMain());
-
-    RefPtr<NetworkResourceLoader> loader = m_networkResourceLoaders.get(identifier);
-    if (!loader)
-        return;
-
-    loader->setDefersLoading(defers);
-}
-
 void NetworkConnectionToWebProcess::prefetchDNS(const String& hostname)
 {
     m_networkProcess->prefetchDNS(hostname);
index a3cae88..f5618e6 100644 (file)
@@ -149,7 +149,6 @@ private:
 
     void removeLoadIdentifier(ResourceLoadIdentifier);
     void pageLoadCompleted(uint64_t webPageID);
-    void setDefersLoading(ResourceLoadIdentifier, bool);
     void crossOriginRedirectReceived(ResourceLoadIdentifier, const URL& redirectURL);
     void startDownload(PAL::SessionID, DownloadID, const WebCore::ResourceRequest&, const String& suggestedName = { });
     void convertMainResourceLoadToDownload(PAL::SessionID, uint64_t mainResourceLoadIdentifier, DownloadID, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
index 67afabb..3f1613b 100644 (file)
@@ -27,7 +27,6 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver {
     LoadPing(WebKit::NetworkResourceLoadParameters resourceLoadParameters)
     RemoveLoadIdentifier(uint64_t resourceLoadIdentifier)
     PageLoadCompleted(uint64_t webPageID)
-    SetDefersLoading(uint64_t resourceLoadIdentifier, bool defers)
     PrefetchDNS(String hostname)
     PreconnectTo(uint64_t preconnectionIdentifier, WebKit::NetworkResourceLoadParameters loadParameters);
 
index e104ce5..9c19720 100644 (file)
@@ -83,7 +83,6 @@ public:
 
     virtual ~NetworkDataTask();
 
-    virtual void suspend() = 0;
     virtual void cancel() = 0;
     virtual void resume() = 0;
     virtual void invalidateAndCancel() = 0;
index a6db241..beb8b36 100644 (file)
@@ -144,11 +144,6 @@ void NetworkDataTaskBlob::resume()
     });
 }
 
-void NetworkDataTaskBlob::suspend()
-{
-    // FIXME: can this happen?
-}
-
 void NetworkDataTaskBlob::cancel()
 {
     if (m_state == State::Canceling || m_state == State::Completed)
index 7df999f..56cf602 100644 (file)
@@ -59,7 +59,6 @@ public:
 private:
     NetworkDataTaskBlob(NetworkSession&, WebCore::BlobRegistryImpl&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, WebCore::ContentSniffingPolicy, const Vector<RefPtr<WebCore::BlobDataFileReference>>&);
 
-    void suspend() override;
     void cancel() override;
     void resume() override;
     void invalidateAndCancel() override;
index fd62a14..5b2e948 100644 (file)
@@ -69,8 +69,7 @@ void NetworkLoad::initialize(NetworkSession& networkSession, WebCore::BlobRegist
     else
         m_task = NetworkDataTask::create(networkSession, *this, m_parameters);
 
-    if (!m_parameters.defersLoading)
-        m_task->resume();
+    m_task->resume();
 }
 
 NetworkLoad::~NetworkLoad()
@@ -82,16 +81,6 @@ NetworkLoad::~NetworkLoad()
         m_task->clearClient();
 }
 
-void NetworkLoad::setDefersLoading(bool defers)
-{
-    if (m_task) {
-        if (defers)
-            m_task->suspend();
-        else
-            m_task->resume();
-    }
-}
-
 void NetworkLoad::cancel()
 {
     if (m_task)
index 019dd73..5a51b29 100644 (file)
@@ -47,7 +47,6 @@ public:
     NetworkLoad(NetworkLoadClient&, WebCore::BlobRegistryImpl*, NetworkLoadParameters&&, NetworkSession&);
     ~NetworkLoad();
 
-    void setDefersLoading(bool);
     void cancel();
 
     bool isAllowedToAskUserForCredentials() const;
index c56e8eb..896399d 100644 (file)
@@ -48,7 +48,6 @@ public:
     WebCore::StoredCredentialsPolicy storedCredentialsPolicy { WebCore::StoredCredentialsPolicy::DoNotUse };
     WebCore::ClientCredentialPolicy clientCredentialPolicy { WebCore::ClientCredentialPolicy::CannotAskClientForCredentials };
     bool shouldClearReferrerOnHTTPSToHTTPRedirect { true };
-    bool defersLoading { false };
     bool needsCertificateInfo { false };
     bool isMainFrameNavigation { false };
     Vector<RefPtr<WebCore::BlobDataFileReference>> blobFileReferences;
index cfe58e1..58aacb9 100644 (file)
@@ -76,7 +76,6 @@ void NetworkResourceLoadParameters::encode(IPC::Encoder& encoder) const
     encoder.encodeEnum(clientCredentialPolicy);
     encoder.encodeEnum(shouldPreconnectOnly);
     encoder << shouldClearReferrerOnHTTPSToHTTPRedirect;
-    encoder << defersLoading;
     encoder << needsCertificateInfo;
     encoder << isMainFrameNavigation;
     encoder << maximumBufferingTime;
@@ -163,8 +162,6 @@ bool NetworkResourceLoadParameters::decode(IPC::Decoder& decoder, NetworkResourc
         return false;
     if (!decoder.decode(result.shouldClearReferrerOnHTTPSToHTTPRedirect))
         return false;
-    if (!decoder.decode(result.defersLoading))
-        return false;
     if (!decoder.decode(result.needsCertificateInfo))
         return false;
     if (!decoder.decode(result.isMainFrameNavigation))
index fe8dca2..9f0d202 100644 (file)
@@ -94,7 +94,6 @@ NetworkResourceLoader::NetworkResourceLoader(NetworkResourceLoadParameters&& par
     : m_parameters { WTFMove(parameters) }
     , m_connection { connection }
     , m_fileReferences(connection.resolveBlobReferences(m_parameters))
-    , m_defersLoading { parameters.defersLoading }
     , m_isAllowedToAskUserForCredentials { m_parameters.clientCredentialPolicy == ClientCredentialPolicy::MayAskClientForCredentials }
     , m_bufferingTimer { *this, &NetworkResourceLoader::bufferingTimerFired }
     , m_cache { sessionID().isEphemeral() ? nullptr : connection.networkProcess().cache() }
@@ -166,11 +165,6 @@ void NetworkResourceLoader::start()
 
     m_networkActivityTracker = m_connection->startTrackingResourceLoad(m_parameters.webPageID, m_parameters.identifier, isMainResource(), sessionID());
 
-    if (m_defersLoading) {
-        RELEASE_LOG_IF_ALLOWED("start: Loading is deferred (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ", isMainResource = %d, isSynchronous = %d, parentPID = %d)", m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier, isMainResource(), isSynchronous(), m_parameters.parentPID);
-        return;
-    }
-
     ASSERT(!m_wasStarted);
     m_wasStarted = true;
 
@@ -272,7 +266,6 @@ void NetworkResourceLoader::startNetworkLoad(ResourceRequest&& request, FirstLoa
     }
 
     NetworkLoadParameters parameters = m_parameters;
-    parameters.defersLoading = m_defersLoading;
     parameters.networkActivityTracker = m_networkActivityTracker;
     if (m_networkLoadChecker)
         parameters.storedCredentialsPolicy = m_networkLoadChecker->storedCredentialsPolicy();
@@ -297,33 +290,6 @@ void NetworkResourceLoader::startNetworkLoad(ResourceRequest&& request, FirstLoa
     m_networkLoad = std::make_unique<NetworkLoad>(*this, &m_connection->blobRegistry(), WTFMove(parameters), *networkSession);
 
     RELEASE_LOG_IF_ALLOWED("startNetworkLoad: (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ", description = %{public}s)", m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier, m_networkLoad->description().utf8().data());
-
-    if (m_defersLoading) {
-        RELEASE_LOG_IF_ALLOWED("startNetworkLoad: Created, but deferred (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")",
-            m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier);
-    }
-}
-
-void NetworkResourceLoader::setDefersLoading(bool defers)
-{
-    if (m_defersLoading == defers)
-        return;
-    m_defersLoading = defers;
-
-    if (defers)
-        RELEASE_LOG_IF_ALLOWED("setDefersLoading: Deferring resource load (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")", m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier);
-    else
-        RELEASE_LOG_IF_ALLOWED("setDefersLoading: Resuming deferred resource load (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")", m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier);
-
-    if (m_networkLoad) {
-        m_networkLoad->setDefersLoading(defers);
-        return;
-    }
-
-    if (!m_defersLoading && !m_wasStarted)
-        start();
-    else
-        RELEASE_LOG_IF_ALLOWED("setDefersLoading: defers = %d, but nothing to do (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")", m_defersLoading, m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier);
 }
 
 void NetworkResourceLoader::cleanup(LoadResult result)
index e7ccb81..5bee9e2 100644 (file)
@@ -72,8 +72,6 @@ public:
     void start();
     void abort();
 
-    void setDefersLoading(bool);
-
     // Message handlers.
     void didReceiveNetworkResourceLoaderMessage(IPC::Connection&, IPC::Decoder&);
 
@@ -191,7 +189,6 @@ private:
 
     bool m_wasStarted { false };
     bool m_didConsumeSandboxExtensions { false };
-    bool m_defersLoading { false };
     bool m_isAllowedToAskUserForCredentials { false };
     size_t m_numBytesReceived { 0 };
 
index 2075408..2ce677d 100644 (file)
@@ -60,7 +60,6 @@ public:
     void willPerformHTTPRedirection(WebCore::ResourceResponse&&, WebCore::ResourceRequest&&, RedirectCompletionHandler&&);
     void transferSandboxExtensionToDownload(Download&);
 
-    void suspend() override;
     void cancel() override;
     void resume() override;
     void invalidateAndCancel() override { }
index 46c9c76..f959cd9 100644 (file)
@@ -476,13 +476,6 @@ void NetworkDataTaskCocoa::resume()
     [m_task resume];
 }
 
-void NetworkDataTaskCocoa::suspend()
-{
-    if (m_failureTimer.isActive())
-        m_failureTimer.stop();
-    [m_task suspend];
-}
-
 NetworkDataTask::State NetworkDataTaskCocoa::state() const
 {
     switch ([m_task state]) {
index 5610bef..67786fd 100644 (file)
@@ -96,18 +96,6 @@ void NetworkDataTaskCurl::resume()
         m_curlRequest->resume();
 }
 
-void NetworkDataTaskCurl::suspend()
-{
-    ASSERT(m_state != State::Suspended);
-    if (m_state == State::Canceling || m_state == State::Completed)
-        return;
-
-    m_state = State::Suspended;
-
-    if (m_curlRequest)
-        m_curlRequest->suspend();
-}
-
 void NetworkDataTaskCurl::cancel()
 {
     if (m_state == State::Canceling || m_state == State::Completed)
index cb97360..3c07de5 100644 (file)
@@ -57,7 +57,6 @@ private:
 
     NetworkDataTaskCurl(NetworkSession&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, WebCore::StoredCredentialsPolicy, WebCore::ContentSniffingPolicy, WebCore::ContentEncodingSniffingPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, bool dataTaskIsForMainFrameNavigation);
 
-    void suspend() override;
     void cancel() override;
     void resume() override;
     void invalidateAndCancel() override;
index 3905188..54aaa62 100644 (file)
@@ -235,16 +235,6 @@ void NetworkDataTaskSoup::resume()
     }
 }
 
-void NetworkDataTaskSoup::suspend()
-{
-    ASSERT(m_state != State::Suspended);
-    if (m_state == State::Canceling || m_state == State::Completed)
-        return;
-    m_state = State::Suspended;
-
-    stopTimeout();
-}
-
 void NetworkDataTaskSoup::cancel()
 {
     if (m_state == State::Canceling || m_state == State::Completed)
index d711c79..ad3063d 100644 (file)
@@ -46,7 +46,6 @@ public:
 private:
     NetworkDataTaskSoup(NetworkSession&, NetworkDataTaskClient&, const WebCore::ResourceRequest&, WebCore::StoredCredentialsPolicy, WebCore::ContentSniffingPolicy, WebCore::ContentEncodingSniffingPolicy, bool shouldClearReferrerOnHTTPSToHTTPRedirect, bool dataTaskIsForMainFrameNavigation);
 
-    void suspend() override;
     void cancel() override;
     void resume() override;
     void invalidateAndCancel() override;
index 7678b0c..fa8ca71 100644 (file)
@@ -277,7 +277,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL
     // If there is no WebFrame then this resource cannot be authenticated with the client.
     loadParameters.clientCredentialPolicy = (loadParameters.webFrameID && loadParameters.webPageID && resourceLoader.isAllowedToAskUserForCredentials()) ? ClientCredentialPolicy::MayAskClientForCredentials : ClientCredentialPolicy::CannotAskClientForCredentials;
     loadParameters.shouldClearReferrerOnHTTPSToHTTPRedirect = shouldClearReferrerOnHTTPSToHTTPRedirect;
-    loadParameters.defersLoading = resourceLoader.defersLoading();
     loadParameters.needsCertificateInfo = resourceLoader.shouldIncludeCertificateInfo();
     loadParameters.maximumBufferingTime = maximumBufferingTime;
     loadParameters.options = resourceLoader.options();
@@ -426,10 +425,9 @@ void WebLoaderStrategy::remove(ResourceLoader* resourceLoader)
     loader->detachFromCoreLoader();
 }
 
-void WebLoaderStrategy::setDefersLoading(ResourceLoader& resourceLoader, bool defers)
+void WebLoaderStrategy::setDefersLoading(ResourceLoader&, bool)
 {
-    ResourceLoadIdentifier identifier = resourceLoader.identifier();
-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
+    ASSERT_NOT_REACHED();
 }
 
 void WebLoaderStrategy::crossOriginRedirectReceived(ResourceLoader*, const URL&)
index d9df508..afeb407 100644 (file)
@@ -1,5 +1,17 @@
 2019-02-12  Alex Christensen  <achristensen@webkit.org>
 
+        Remove setDefersLoading infrastructure from WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=194506
+
+        Reviewed by Brady Eidson.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setDefersLoading): Deleted.
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
+2019-02-12  Alex Christensen  <achristensen@webkit.org>
+
         WebPage::close needs to remove all message receivers associated with that WebPage, not WebPage::~WebPage
         https://bugs.webkit.org/show_bug.cgi?id=194522
         <rdar://problem/47789393>
index dabe19c..47cd9fc 100644 (file)
@@ -169,7 +169,6 @@ interface TestRunner {
     
     void setShouldStayOnPageAfterHandlingBeforeUnload(boolean flag);
 
-    void setDefersLoading(boolean flag);
     void setStopProvisionalFrameLoads();
 
     readonly attribute boolean didReceiveServerRedirectForProvisionalNavigation;
index 3df7e54..df450b9 100644 (file)
@@ -741,10 +741,6 @@ void TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(bool shouldStayOnP
     InjectedBundle::singleton().postNewBeforeUnloadReturnValue(!shouldStayOnPage);
 }
 
-void TestRunner::setDefersLoading(bool)
-{
-}
-
 bool TestRunner::didReceiveServerRedirectForProvisionalNavigation() const
 {
     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DidReceiveServerRedirectForProvisionalNavigation"));
index e3b0c26..01fa7b8 100644 (file)
@@ -263,8 +263,6 @@ public:
 
     void setShouldStayOnPageAfterHandlingBeforeUnload(bool);
 
-    void setDefersLoading(bool);
-
     void setStopProvisionalFrameLoads() { m_shouldStopProvisionalFrameLoads = true; }
     bool shouldStopProvisionalFrameLoads() const { return m_shouldStopProvisionalFrameLoads; }