Title: [134328] trunk/Source/WebKit2
Revision
134328
Author
[email protected]
Date
2012-11-12 17:03:56 -0800 (Mon, 12 Nov 2012)

Log Message

Get rid of the CrossOriginRedirectReceived message to the NetworkProcess.
https://bugs.webkit.org/show_bug.cgi?id=102010

Reviewed by Alexey Proskuryakov.

This message was a stop-gap measure for when the NetworkProcess did scheduling but not loading.
Now that the NetworkProcess does loading it doesn't need to be told when redirect is received.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in: Get rid of the message to the NetworkProcess.

* NetworkProcess/NetworkRequest.cpp:
(WebKit::NetworkRequest::willSendRequest): After willSendRequest is dispatched to the WebProcess, directly call
  "receivedRedirect" on the NetworkResourceLoadScheduler.

* NetworkProcess/NetworkResourceLoadScheduler.cpp:
(WebKit::NetworkResourceLoadScheduler::receivedRedirect): Renamed from crossOriginRedirectReceived, as the
  function already checks to see if the redirect was actually cross-origin.
* NetworkProcess/NetworkResourceLoadScheduler.h:

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::crossOriginRedirectReceived): A no-op so the WebProcess doesn't
  do any host record accounting of its own.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (134327 => 134328)


--- trunk/Source/WebKit2/ChangeLog	2012-11-13 00:36:17 UTC (rev 134327)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-13 01:03:56 UTC (rev 134328)
@@ -1,3 +1,29 @@
+2012-11-12  Brady Eidson  <[email protected]>
+
+        Get rid of the CrossOriginRedirectReceived message to the NetworkProcess.
+        https://bugs.webkit.org/show_bug.cgi?id=102010
+
+        Reviewed by Alexey Proskuryakov.
+
+        This message was a stop-gap measure for when the NetworkProcess did scheduling but not loading.
+        Now that the NetworkProcess does loading it doesn't need to be told when redirect is received.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Get rid of the message to the NetworkProcess.
+
+        * NetworkProcess/NetworkRequest.cpp:
+        (WebKit::NetworkRequest::willSendRequest): After willSendRequest is dispatched to the WebProcess, directly call
+          "receivedRedirect" on the NetworkResourceLoadScheduler.
+
+        * NetworkProcess/NetworkResourceLoadScheduler.cpp:
+        (WebKit::NetworkResourceLoadScheduler::receivedRedirect): Renamed from crossOriginRedirectReceived, as the
+          function already checks to see if the redirect was actually cross-origin.
+        * NetworkProcess/NetworkResourceLoadScheduler.h:
+
+        * WebProcess/Network/WebResourceLoadScheduler.cpp:
+        (WebKit::WebResourceLoadScheduler::crossOriginRedirectReceived): A no-op so the WebProcess doesn't
+          do any host record accounting of its own.
+
 2012-11-12  Tim Horton  <[email protected]>
 
         PDFPlugin should use PDFKit's context menu instead of the default WebKit one

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (134327 => 134328)


--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2012-11-13 00:36:17 UTC (rev 134327)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2012-11-13 01:03:56 UTC (rev 134328)
@@ -125,11 +125,6 @@
     NetworkProcess::shared().networkResourceLoadScheduler().removeLoadIdentifier(identifier);
 }
 
-void NetworkConnectionToWebProcess::crossOriginRedirectReceived(ResourceLoadIdentifier identifier, const KURL& redirectURL)
-{
-    NetworkProcess::shared().networkResourceLoadScheduler().crossOriginRedirectReceived(identifier, redirectURL);
-}
-
 void NetworkConnectionToWebProcess::servePendingRequests(uint32_t resourceLoadPriority)
 {
     NetworkProcess::shared().networkResourceLoadScheduler().servePendingRequests(static_cast<ResourceLoadPriority>(resourceLoadPriority));

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in (134327 => 134328)


--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2012-11-13 00:36:17 UTC (rev 134327)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2012-11-13 01:03:56 UTC (rev 134328)
@@ -31,10 +31,6 @@
     ScheduleNetworkRequest(WebCore::ResourceRequest request, uint32_t resourceLoadPriority, bool shouldContentSniff) -> (uint64_t resourceLoadIdentifier)
     AddLoadInProgress(WebCore::KURL url) -> (uint64_t resourceLoadIdentifier)
     RemoveLoadIdentifier(uint64_t resourceLoadIdentifier)
-
-    // It's possible that we will be able to do away with this message and have the NetworkProcess
-    // manage it internally.
-    crossOriginRedirectReceived(uint64_t resourceLoadIdentifier, WebCore::KURL redirectURL) -> ()
     
     ServePendingRequests(uint32_t resourceLoadPriority)
 

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkRequest.cpp (134327 => 134328)


--- trunk/Source/WebKit2/NetworkProcess/NetworkRequest.cpp	2012-11-13 00:36:17 UTC (rev 134327)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkRequest.cpp	2012-11-13 01:03:56 UTC (rev 134328)
@@ -206,6 +206,9 @@
 
 void NetworkRequest::willSendRequest(ResourceHandle*, ResourceRequest& request, const ResourceResponse& redirectResponse)
 {
+    // We only expect to get the willSendRequest callback from ResourceHandle as the result of a redirect
+    ASSERT(!redirectResponse.isNull());
+
     uint64_t requestID = generateWillSendRequestID();
 
     if (!connectionToWebProcess()->connection()->send(Messages::NetworkProcessConnection::WillSendRequest(requestID, m_identifier, request, redirectResponse), 0)) {
@@ -215,6 +218,8 @@
     
     OwnPtr<ResourceRequest> newRequest = responseMap().waitForResponse(requestID);
     request = *newRequest;
+
+    NetworkProcess::shared().networkResourceLoadScheduler().receivedRedirect(m_identifier, request.url());
 }
 
 void NetworkRequest::didSendData(WebCore::ResourceHandle*, unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/)

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp (134327 => 134328)


--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp	2012-11-13 00:36:17 UTC (rev 134327)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp	2012-11-13 01:03:56 UTC (rev 134328)
@@ -107,10 +107,10 @@
     scheduleServePendingRequests();
 }
 
-void NetworkResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoadIdentifier identifier, const WebCore::KURL& redirectURL)
+void NetworkResourceLoadScheduler::receivedRedirect(ResourceLoadIdentifier identifier, const WebCore::KURL& redirectURL)
 {
     ASSERT(isMainThread());
-    LOG(NetworkScheduling, "(NetworkProcess) NetworkResourceLoadScheduler::crossOriginRedirectReceived resource %llu redirected to '%s'", identifier, redirectURL.string().utf8().data());
+    LOG(NetworkScheduling, "(NetworkProcess) NetworkResourceLoadScheduler::receivedRedirect resource %llu redirected to '%s'", identifier, redirectURL.string().utf8().data());
 
     HostRecord* oldHost = m_identifiers.get(identifier);
     HostRecord* newHost = hostForURL(redirectURL, CreateIfNotFound);

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.h (134327 => 134328)


--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.h	2012-11-13 00:36:17 UTC (rev 134327)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.h	2012-11-13 01:03:56 UTC (rev 134328)
@@ -57,7 +57,7 @@
     // Called within the NetworkProcess on a background thread when a resource load has finished.
     void scheduleRemoveLoadIdentifier(ResourceLoadIdentifier);
 
-    void crossOriginRedirectReceived(ResourceLoadIdentifier, const WebCore::KURL& redirectURL);
+    void receivedRedirect(ResourceLoadIdentifier, const WebCore::KURL& redirectURL);
     void servePendingRequests(WebCore::ResourceLoadPriority = WebCore::ResourceLoadPriorityVeryLow);
     void suspendPendingRequests();
     void resumePendingRequests();

Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp (134327 => 134328)


--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp	2012-11-13 00:36:17 UTC (rev 134327)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp	2012-11-13 01:03:56 UTC (rev 134328)
@@ -148,17 +148,10 @@
     m_activeResourceLoaders.remove(identifier);
 }
 
-void WebResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoader* resourceLoader, const KURL& redirectURL)
+void WebResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoader*, const KURL&)
 {
-    LOG(NetworkScheduling, "(WebProcess) WebResourceLoadScheduler::crossOriginRedirectReceived. From '%s' to '%s'", resourceLoader->url().string().utf8().data(), redirectURL.string().utf8().data());
-
-    ASSERT(resourceLoader);
-    ASSERT(resourceLoader->identifier());
-
-    if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::crossOriginRedirectReceived(resourceLoader->identifier(), redirectURL), Messages::NetworkConnectionToWebProcess::crossOriginRedirectReceived::Reply(), 0)) {
-        // FIXME (NetworkProcess): What should we do if this fails?
-        ASSERT_NOT_REACHED();
-    }
+    // We handle cross origin redirects entirely within the NetworkProcess.
+    // We override this call in the WebProcess to make it a no-op.
 }
 
 void WebResourceLoadScheduler::servePendingRequests(ResourceLoadPriority minimumPriority)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to