[WK2] Assertion failures when loading XSL stylesheets with NetworkProcess
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 16:51:13 +0000 (16:51 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 16:51:13 +0000 (16:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120186
<rdar://problem/14080273>

Reviewed by Brady Eidson.

Covered by many existing tests.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::loadResourceSynchronously): Pass frame ID and page ID.
They are mostly needed for authentication, which is not supported with sync requests,
but it will be supported some day.

* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::webFrameLoaderClient):
Added a way to get frame loader client from WebKit NetworkingContext subclass.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

index 3c21d9f..227b580 100644 (file)
@@ -1,3 +1,23 @@
+2013-08-23  Alexey Proskuryakov  <ap@apple.com>
+
+        [WK2] Assertion failures when loading XSL stylesheets with NetworkProcess
+        https://bugs.webkit.org/show_bug.cgi?id=120186
+        <rdar://problem/14080273>
+
+        Reviewed by Brady Eidson.
+
+        Covered by many existing tests.
+
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::loadResourceSynchronously): Pass frame ID and page ID.
+        They are mostly needed for authentication, which is not supported with sync requests,
+        but it will be supported some day.
+
+        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
+        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
+        (WebKit::WebFrameNetworkingContext::webFrameLoaderClient):
+        Added a way to get frame loader client from WebKit NetworkingContext subclass.
+
 2013-08-22  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Wrong interface version used in WebKitWebPage for loader client
index e24ad23..19ea6c8 100644 (file)
@@ -35,6 +35,7 @@
 #include "WebCookieManager.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebErrors.h"
+#include "WebFrameNetworkingContext.h"
 #include "WebPage.h"
 #include "WebProcess.h"
 #include "WebProcessProxyMessages.h"
@@ -233,10 +234,20 @@ void WebPlatformStrategies::loadResourceSynchronously(NetworkingContext* context
         return;
     }
 
+    WebFrameNetworkingContext* webContext = static_cast<WebFrameNetworkingContext*>(context);
+    // FIXME: Some entities in WebCore use WebCore's "EmptyFrameLoaderClient" instead of having a proper WebFrameLoaderClient.
+    // EmptyFrameLoaderClient shouldn't exist and everything should be using a WebFrameLoaderClient,
+    // but in the meantime we have to make sure not to mis-cast.
+    WebFrameLoaderClient* webFrameLoaderClient = webContext->webFrameLoaderClient();
+    WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : 0;
+    WebPage* webPage = webFrame ? webFrame->page() : 0;
+
     CoreIPC::DataReference dataReference;
 
     NetworkResourceLoadParameters loadParameters;
     loadParameters.identifier = resourceLoadIdentifier;
+    loadParameters.webPageID = webPage ? webPage->pageID() : 0;
+    loadParameters.webFrameID = webFrame ? webFrame->frameID() : 0;
     loadParameters.request = request;
     loadParameters.priority = ResourceLoadPriorityHighest;
     loadParameters.contentSniffingPolicy = SniffContent;
index fdbc8f5..01b99d3 100644 (file)
@@ -44,6 +44,8 @@ public:
     static void destroyPrivateBrowsingSession();
     static void setCookieAcceptPolicyForAllContexts(HTTPCookieAcceptPolicy);
 
+    WebFrameLoaderClient* webFrameLoaderClient() const;
+
 private:
     WebFrameNetworkingContext(WebFrame* frame)
         : WebCore::FrameNetworkingContext(frame->coreFrame())
index a2577d8..0cf6800 100644 (file)
@@ -123,4 +123,12 @@ NetworkStorageSession& WebFrameNetworkingContext::storageSession() const
     return NetworkStorageSession::defaultStorageSession();
 }
     
+WebFrameLoaderClient* WebFrameNetworkingContext::webFrameLoaderClient() const
+{
+    if (!frame())
+        return 0;
+
+    return toWebFrameLoaderClient(frame()->loader().client());
+}
+
 }