Title: [169219] branches/safari-537.77-branch/Source

Diff

Modified: branches/safari-537.77-branch/Source/WebCore/ChangeLog (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebCore/ChangeLog	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebCore/ChangeLog	2014-05-22 21:35:30 UTC (rev 169219)
@@ -1,3 +1,23 @@
+2014-05-22  Lucas Forschler  <[email protected]>
+
+        Merge r167635
+
+    2014-04-21  Dan Bernstein  <[email protected]>
+
+            WebCore part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
+            https://bugs.webkit.org/show_bug.cgi?id=131939
+
+            Reviewed by David Kilzer.
+
+            * WebCore.exp.in: Exported WebCore::ResourceHandle::setDefersLoading.
+
+            * loader/ResourceLoadScheduler.cpp:
+            (WebCore::ResourceLoadScheduler::setDefersLoading): Added a no-op implementation.
+            * loader/ResourceLoadScheduler.h: Declared new virtual member function setDefersLoading.
+
+            * loader/ResourceLoader.cpp:
+            (WebCore::ResourceLoader::setDefersLoading): Added a call to the above function.
+
 2014-05-22  Dana Burkart  <[email protected]>
 
         Merge r167264

Modified: branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in	2014-05-22 21:35:30 UTC (rev 169219)
@@ -343,6 +343,7 @@
 __ZN7WebCore14ResourceBufferD1Ev
 __ZN7WebCore14ResourceBufferD2Ev
 __ZN7WebCore14ResourceHandle12firstRequestEv
+__ZN7WebCore14ResourceHandle16setDefersLoadingEb
 __ZN7WebCore14ResourceHandle20forceContentSniffingEv
 __ZN7WebCore14ResourceHandle23continueWillSendRequestERKNS_15ResourceRequestE
 __ZN7WebCore14ResourceHandle25continueWillCacheResponseEP19NSCachedURLResponse

Modified: branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoadScheduler.cpp (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoadScheduler.cpp	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoadScheduler.cpp	2014-05-22 21:35:30 UTC (rev 169219)
@@ -160,6 +160,10 @@
     scheduleServePendingRequests();
 }
 
+void ResourceLoadScheduler::setDefersLoading(ResourceLoader*, bool)
+{
+}
+
 void ResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoader* resourceLoader, const KURL& redirectURL)
 {
     HostInformation* oldHost = hostForURL(resourceLoader->url());

Modified: branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoadScheduler.h (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoadScheduler.h	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoadScheduler.h	2014-05-22 21:35:30 UTC (rev 169219)
@@ -54,6 +54,7 @@
     virtual PassRefPtr<NetscapePlugInStreamLoader> schedulePluginStreamLoad(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&);
     virtual void remove(ResourceLoader*);
     virtual void crossOriginRedirectReceived(ResourceLoader*, const KURL& redirectURL);
+    virtual void setDefersLoading(ResourceLoader*, bool);
     
     virtual void servePendingRequests(ResourceLoadPriority minimumPriority = ResourceLoadPriorityVeryLow);
     virtual void suspendPendingRequests();

Modified: branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoader.cpp (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoader.cpp	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebCore/loader/ResourceLoader.cpp	2014-05-22 21:35:30 UTC (rev 169219)
@@ -170,6 +170,8 @@
         m_deferredRequest = ResourceRequest();
         start();
     }
+
+    platformStrategies()->loaderStrategy()->resourceLoadScheduler()->setDefersLoading(this, defers);
 }
 
 FrameLoader* ResourceLoader::frameLoader() const

Modified: branches/safari-537.77-branch/Source/WebKit2/ChangeLog (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/ChangeLog	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/ChangeLog	2014-05-22 21:35:30 UTC (rev 169219)
@@ -1,3 +1,44 @@
+2014-05-22  Lucas Forschler  <[email protected]>
+
+        Merge r167635
+
+    2014-04-21  Dan Bernstein  <[email protected]>
+
+            WebKit part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
+            https://bugs.webkit.org/show_bug.cgi?id=131939
+
+            Reviewed by David Kilzer.
+
+            * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+            (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Added. Forwards the message to
+            the NetworkResourceLoader. 
+            * NetworkProcess/NetworkConnectionToWebProcess.h:
+
+            * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Added SetDefersLoading message.
+
+            * NetworkProcess/NetworkResourceLoader.cpp:
+            (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize new member variable
+            m_defersLoading from the new field in the loader parameters.
+            (WebKit::NetworkResourceLoader::start): Added. Like WebCore::ResourceLoader, if loading is
+            deferred, keep the request in m_deferredRequest and bail out.
+            (WebKit::NetworkResourceLoader::setDefersLoading): Added. Similar to
+            WebCore::ResourceLoader::setDefersLoading.
+            * NetworkProcess/NetworkResourceLoader.h:
+            (WebKit::NetworkResourceLoader::defersLoading): 
+
+            * Shared/Network/NetworkResourceLoadParameters.cpp:
+            (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Initialize new field
+            defersLoading to false.
+            (WebKit::NetworkResourceLoadParameters::encode): Encode new field.
+            (WebKit::NetworkResourceLoadParameters::decode): Decode new field.
+            * Shared/Network/NetworkResourceLoadParameters.h: Added defersLoading field.
+
+            * WebProcess/Network/WebResourceLoadScheduler.cpp:
+            (WebKit::WebResourceLoadScheduler::scheduleLoad): Populate defersLoading field in the load
+            parameters.
+            (WebKit::WebResourceLoadScheduler::setDefersLoading): Send a message to the Network process.
+            * WebProcess/Network/WebResourceLoadScheduler.h:
+
 2014-04-30  Lucas Forschler  <[email protected]>
 
         Merge r166810

Modified: branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2014-05-22 21:35:30 UTC (rev 169219)
@@ -137,6 +137,15 @@
     loader->abort();
 }
 
+void NetworkConnectionToWebProcess::setDefersLoading(ResourceLoadIdentifier identifier, bool defers)
+{
+    RefPtr<NetworkResourceLoader> loader = m_networkResourceLoaders.get(identifier);
+    if (!loader)
+        return;
+
+    loader->setDefersLoading(defers);
+}
+
 void NetworkConnectionToWebProcess::servePendingRequests(uint32_t resourceLoadPriority)
 {
     NetworkProcess::shared().networkResourceLoadScheduler().servePendingRequests(static_cast<ResourceLoadPriority>(resourceLoadPriority));

Modified: branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h	2014-05-22 21:35:30 UTC (rev 169219)
@@ -74,6 +74,7 @@
 
     void removeLoadIdentifier(ResourceLoadIdentifier);
     void crossOriginRedirectReceived(ResourceLoadIdentifier, const WebCore::KURL& redirectURL);
+    void setDefersLoading(ResourceLoadIdentifier, bool);
     void servePendingRequests(uint32_t resourceLoadPriority);
     void setSerialLoadingEnabled(bool);
     void startDownload(bool privateBrowsingEnabled, uint64_t downloadID, const WebCore::ResourceRequest&);

Modified: branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2014-05-22 21:35:30 UTC (rev 169219)
@@ -27,6 +27,7 @@
     ScheduleResourceLoad(WebKit::NetworkResourceLoadParameters resourceLoadParameters)
     PerformSynchronousLoad(WebKit::NetworkResourceLoadParameters resourceLoadParameters) -> (WebCore::ResourceError error, WebCore::ResourceResponse response, Vector<char> data) Delayed
     RemoveLoadIdentifier(uint64_t resourceLoadIdentifier)
+    SetDefersLoading(uint64_t resourceLoadIdentifier, bool defers)
     
     ServePendingRequests(uint32_t resourceLoadPriority)
     

Modified: branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp	2014-05-22 21:35:30 UTC (rev 169219)
@@ -68,6 +68,7 @@
     , m_inPrivateBrowsingMode(parameters.inPrivateBrowsingMode)
     , m_shouldClearReferrerOnHTTPSToHTTPRedirect(parameters.shouldClearReferrerOnHTTPSToHTTPRedirect)
     , m_isLoadingMainResource(parameters.isMainResource)
+    , m_defersLoading(parameters.defersLoading)
     , m_sandboxExtensionsAreConsumed(false)
     , m_connection(connection)
 {
@@ -130,12 +131,29 @@
     // FIXME (NetworkProcess): Create RemoteNetworkingContext with actual settings.
     m_networkingContext = RemoteNetworkingContext::create(false, false, m_inPrivateBrowsingMode, m_shouldClearReferrerOnHTTPSToHTTPRedirect);
 
+    if (m_defersLoading) {
+        m_deferredRequest = m_request;
+        return;
+    }
+
     consumeSandboxExtensions();
 
     // FIXME (NetworkProcess): Pass an actual value for defersLoading
     m_handle = ResourceHandle::create(m_networkingContext.get(), m_request, this, false /* defersLoading */, m_contentSniffingPolicy == SniffContent);
 }
 
+void NetworkResourceLoader::setDefersLoading(bool defers)
+{
+    m_defersLoading = defers;
+    if (m_handle)
+        m_handle->setDefersLoading(defers);
+    if (!defers && !m_deferredRequest.isNull()) {
+        m_request = m_deferredRequest;
+        m_deferredRequest = ResourceRequest();
+        start();
+    }
+}
+
 void NetworkResourceLoader::cleanup()
 {
     ASSERT(isMainThread());

Modified: branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h	2014-05-22 21:35:30 UTC (rev 169219)
@@ -78,6 +78,9 @@
     void start();
     void abort();
 
+    void setDefersLoading(bool);
+    bool defersLoading() const { return m_defersLoading; }
+
     // ResourceHandleClient methods
     virtual void willSendRequestAsync(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse) OVERRIDE;
     virtual void didSendData(WebCore::ResourceHandle*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) OVERRIDE;
@@ -171,6 +174,7 @@
     uint64_t m_webPageID;
     uint64_t m_webFrameID;
     WebCore::ResourceRequest m_request;
+    WebCore::ResourceRequest m_deferredRequest;
     WebCore::ResourceLoadPriority m_priority;
     WebCore::ContentSniffingPolicy m_contentSniffingPolicy;
     WebCore::StoredCredentials m_allowStoredCredentials;
@@ -178,6 +182,7 @@
     bool m_inPrivateBrowsingMode;
     bool m_shouldClearReferrerOnHTTPSToHTTPRedirect;
     bool m_isLoadingMainResource;
+    bool m_defersLoading;
 
     Vector<RefPtr<SandboxExtension>> m_requestBodySandboxExtensions;
     Vector<RefPtr<SandboxExtension>> m_resourceSandboxExtensions;

Modified: branches/safari-537.77-branch/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp	2014-05-22 21:35:30 UTC (rev 169219)
@@ -48,6 +48,7 @@
     , inPrivateBrowsingMode(false)
     , shouldClearReferrerOnHTTPSToHTTPRedirect(true)
     , isMainResource(false)
+    , defersLoading(false)
 {
 }
 
@@ -97,6 +98,7 @@
     encoder << inPrivateBrowsingMode;
     encoder << shouldClearReferrerOnHTTPSToHTTPRedirect;
     encoder << isMainResource;
+    encoder << defersLoading;
 }
 
 bool NetworkResourceLoadParameters::decode(CoreIPC::ArgumentDecoder& decoder, NetworkResourceLoadParameters& result)
@@ -147,6 +149,8 @@
         return false;
     if (!decoder.decode(result.isMainResource))
         return false;
+    if (!decoder.decode(result.defersLoading))
+        return false;
 
     return true;
 }

Modified: branches/safari-537.77-branch/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h	2014-05-22 21:35:30 UTC (rev 169219)
@@ -62,6 +62,7 @@
     bool inPrivateBrowsingMode;
     bool shouldClearReferrerOnHTTPSToHTTPRedirect;
     bool isMainResource;
+    bool defersLoading;
 };
 
 } // namespace WebKit

Modified: branches/safari-537.77-branch/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp	2014-05-22 21:35:30 UTC (rev 169219)
@@ -125,6 +125,7 @@
     loadParameters.inPrivateBrowsingMode = privateBrowsingEnabled;
     loadParameters.shouldClearReferrerOnHTTPSToHTTPRedirect = shouldClearReferrerOnHTTPSToHTTPRedirect;
     loadParameters.isMainResource = resource && resource->type() == CachedResource::MainResource;
+    loadParameters.defersLoading = resourceLoader->defersLoading();
 
     ASSERT((loadParameters.webPageID && loadParameters.webFrameID) || loadParameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials);
 
@@ -183,6 +184,12 @@
     loader->detachFromCoreLoader();
 }
 
+void WebResourceLoadScheduler::setDefersLoading(ResourceLoader* resourceLoader, bool defers)
+{
+    ResourceLoadIdentifier identifier = resourceLoader->identifier();
+    WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
+}
+
 void WebResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoader*, const KURL&)
 {
     // We handle cross origin redirects entirely within the NetworkProcess.

Modified: branches/safari-537.77-branch/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.h (169218 => 169219)


--- branches/safari-537.77-branch/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.h	2014-05-22 21:16:03 UTC (rev 169218)
+++ branches/safari-537.77-branch/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.h	2014-05-22 21:35:30 UTC (rev 169219)
@@ -50,6 +50,7 @@
     
     virtual void remove(WebCore::ResourceLoader*) OVERRIDE;
     virtual void crossOriginRedirectReceived(WebCore::ResourceLoader*, const WebCore::KURL& redirectURL) OVERRIDE;
+    virtual void setDefersLoading(WebCore::ResourceLoader*, bool) override;
     
     virtual void servePendingRequests(WebCore::ResourceLoadPriority minimumPriority = WebCore::ResourceLoadPriorityVeryLow) OVERRIDE;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to