Title: [148880] trunk/Source/WebKit/blackberry
Revision
148880
Author
commit-qu...@webkit.org
Date
2013-04-22 07:24:52 -0700 (Mon, 22 Apr 2013)

Log Message

[BlackBerry] ASSERT in FrameLoaderClient::convertMainResourceLoadToDownload
https://bugs.webkit.org/show_bug.cgi?id=114741

Patch by Xan Lopez <xlo...@igalia.com> on 2013-04-22
Reviewed by George Staikos.

Consider the case where a ResourceHandle won't have a FilterStream
object associated (for example, Blob objects) instead of ASSERTing
pointlessly when asking our network layer for such an object.

This partially fixes fast/dom/HTMLAnchorElement/anchor-nodownload-set.html

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::convertMainResourceLoadToDownload):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (148879 => 148880)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-04-22 14:19:24 UTC (rev 148879)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-04-22 14:24:52 UTC (rev 148880)
@@ -1,3 +1,19 @@
+2013-04-22  Xan Lopez  <xlo...@igalia.com>
+
+        [BlackBerry] ASSERT in FrameLoaderClient::convertMainResourceLoadToDownload
+        https://bugs.webkit.org/show_bug.cgi?id=114741
+
+        Reviewed by George Staikos.
+
+        Consider the case where a ResourceHandle won't have a FilterStream
+        object associated (for example, Blob objects) instead of ASSERTing
+        pointlessly when asking our network layer for such an object.
+
+        This partially fixes fast/dom/HTMLAnchorElement/anchor-nodownload-set.html
+
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore::FrameLoaderClientBlackBerry::convertMainResourceLoadToDownload):
+
 2013-04-22  Mike Fenton  <mifen...@rim.com>
 
         [BlackBerry] Add additional datalist support.

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp (148879 => 148880)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2013-04-22 14:19:24 UTC (rev 148879)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2013-04-22 14:24:52 UTC (rev 148880)
@@ -1187,9 +1187,18 @@
     m_webPagePrivate->load(request.url().string(), BlackBerry::Platform::String::emptyString(), "GET", NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, false, false, true, "", suggestedName);
 }
 
-void FrameLoaderClientBlackBerry::convertMainResourceLoadToDownload(DocumentLoader* documentLoader, const ResourceRequest&, const ResourceResponse& r)
+void FrameLoaderClientBlackBerry::convertMainResourceLoadToDownload(DocumentLoader* documentLoader, const ResourceRequest& request, const ResourceResponse& r)
 {
     BlackBerry::Platform::FilterStream* stream = NetworkManager::instance()->streamForHandle(documentLoader->mainResourceLoader()->handle());
+    // There are cases where there won't have a FilterStream
+    // associated with a ResourceHandle. For instance, Blob objects
+    // have their own ResourceHandle class which won't call startJob
+    // to do the proper setup. Do it here.
+    if (!stream) {
+        int playerId = static_cast<FrameLoaderClientBlackBerry*>(m_frame->loader()->client())->playerId();
+        NetworkManager::instance()->startJob(playerId, documentLoader->mainResourceLoader()->handle(), request, m_frame, false);
+        stream = NetworkManager::instance()->streamForHandle(documentLoader->mainResourceLoader()->handle());
+    }
     ASSERT(stream);
 
     m_webPagePrivate->m_client->downloadRequested(stream, r.suggestedFilename());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to