Title: [187364] trunk/Source/WebKit2
Revision
187364
Author
[email protected]
Date
2015-07-24 15:01:01 -0700 (Fri, 24 Jul 2015)

Log Message

Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob
https://bugs.webkit.org/show_bug.cgi?id=147276
rdar://problem/21423353

Reviewed by Andreas Kling.

We currently don't support downloading blobs, so for now just bail if we encounter a null loader inside
convertMainResourceLoadToDownload (which happens when trying to download a blob URL).

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
Rewrite the assertion to be more clear - it's fine to do an extra hash lookup in debug builds.

(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
Bail if loader is null.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187363 => 187364)


--- trunk/Source/WebKit2/ChangeLog	2015-07-24 21:45:21 UTC (rev 187363)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-24 22:01:01 UTC (rev 187364)
@@ -1,3 +1,21 @@
+2015-07-24  Anders Carlsson  <[email protected]>
+
+        Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob
+        https://bugs.webkit.org/show_bug.cgi?id=147276
+        rdar://problem/21423353
+
+        Reviewed by Andreas Kling.
+
+        We currently don't support downloading blobs, so for now just bail if we encounter a null loader inside
+        convertMainResourceLoadToDownload (which happens when trying to download a blob URL).
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
+        Rewrite the assertion to be more clear - it's fine to do an extra hash lookup in debug builds.
+
+        (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
+        Bail if loader is null.
+
 2015-07-24  Yusuke Suzuki  <[email protected]>
 
         Remove runtime flags for symbols

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (187363 => 187364)


--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2015-07-24 21:45:21 UTC (rev 187363)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2015-07-24 22:01:01 UTC (rev 187364)
@@ -64,8 +64,9 @@
 
 void NetworkConnectionToWebProcess::didCleanupResourceLoader(NetworkResourceLoader& loader)
 {
-    RefPtr<NetworkResourceLoader> removedLoader = m_networkResourceLoaders.take(loader.identifier());
-    ASSERT(removedLoader == &loader);
+    ASSERT(m_networkResourceLoaders.get(loader.identifier()) == &loader);
+
+    m_networkResourceLoaders.remove(loader.identifier());
 }
     
 void NetworkConnectionToWebProcess::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder)
@@ -186,6 +187,11 @@
     }
 
     NetworkResourceLoader* loader = m_networkResourceLoaders.get(mainResourceLoadIdentifier);
+    if (!loader) {
+        // If we're trying to download a blob here loader can be null.
+        return;
+    }
+
     networkProcess.downloadManager().convertHandleToDownload(downloadID, loader->handle(), request, response);
 
     // Unblock the URL connection operation queue.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to