Title: [139150] trunk
Revision
139150
Author
[email protected]
Date
2013-01-08 19:30:43 -0800 (Tue, 08 Jan 2013)

Log Message

REGRESSION(r138222?): [Mac WK1] http/tests/appcache/main-resource-redirect.html asserts in WebFrameLoaderClient::dispatchDidFinishLoading
https://bugs.webkit.org/show_bug.cgi?id=106123

Reviewed by Alexey Proskuryakov.

Source/WebCore:

No new tests, fixing an existing test.

* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::continueAfterNavigationPolicy): Before calling m_resource->removeClient(this)
    and potentially canceling the ResourceLoader, ensure it won't send resource load callbacks.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::setSendCallbackPolicy):

LayoutTests:

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations: main-resource-redirect.html is no longer crashing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139149 => 139150)


--- trunk/LayoutTests/ChangeLog	2013-01-09 03:28:39 UTC (rev 139149)
+++ trunk/LayoutTests/ChangeLog	2013-01-09 03:30:43 UTC (rev 139150)
@@ -1,3 +1,13 @@
+2013-01-08  Nate Chapin  <[email protected]>
+
+        REGRESSION(r138222?): [Mac WK1] http/tests/appcache/main-resource-redirect.html asserts in WebFrameLoaderClient::dispatchDidFinishLoading
+        https://bugs.webkit.org/show_bug.cgi?id=106123
+
+        Reviewed by Alexey Proskuryakov.
+
+        * platform/mac-wk2/TestExpectations:
+        * platform/mac/TestExpectations: main-resource-redirect.html is no longer crashing.
+
 2013-01-08  Martin Robinson  <[email protected]>
 
         [EFL] [WK2] Some authentication tests fail in WebKit2

Modified: trunk/LayoutTests/platform/mac/TestExpectations (139149 => 139150)


--- trunk/LayoutTests/platform/mac/TestExpectations	2013-01-09 03:28:39 UTC (rev 139149)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2013-01-09 03:30:43 UTC (rev 139150)
@@ -1263,8 +1263,6 @@
 
 webkit.org/b/106075 [ Debug ] fast/regions/full-screen-video-from-region.html [ Crash ]
 
-webkit.org/b/106123 http/tests/appcache/main-resource-redirect.html [ Crash ]
-
 webkit.org/b/106151 [ Lion ] http/tests/misc/link-rel-icon-beforeload.html [ Pass Failure ]
 
 webkit.org/b/106185 fast/frames/flattening/iframe-flattening-fixed-height.html [ Pass Failure ]

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (139149 => 139150)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2013-01-09 03:28:39 UTC (rev 139149)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2013-01-09 03:30:43 UTC (rev 139150)
@@ -295,8 +295,6 @@
 
 webkit.org/b/93552 inspector/device-orientation-success.html [ Failure ]
 
-webkit.org/b/106123 http/tests/appcache/main-resource-redirect.html [ Pass ]
-
 webkit.org/b/106187 platform/mac/tiled-drawing/fixed/absolute-inside-out-of-view-fixed.html [ Failure ]
 webkit.org/b/106187 platform/mac/tiled-drawing/fixed/four-bars-zoomed.html [ Failure ]
 webkit.org/b/106187 platform/mac/tiled-drawing/fixed/negative-scroll-offset.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (139149 => 139150)


--- trunk/Source/WebCore/ChangeLog	2013-01-09 03:28:39 UTC (rev 139149)
+++ trunk/Source/WebCore/ChangeLog	2013-01-09 03:30:43 UTC (rev 139150)
@@ -1,3 +1,18 @@
+2013-01-08  Nate Chapin  <[email protected]>
+
+        REGRESSION(r138222?): [Mac WK1] http/tests/appcache/main-resource-redirect.html asserts in WebFrameLoaderClient::dispatchDidFinishLoading
+        https://bugs.webkit.org/show_bug.cgi?id=106123
+
+        Reviewed by Alexey Proskuryakov.
+
+        No new tests, fixing an existing test.
+
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::continueAfterNavigationPolicy): Before calling m_resource->removeClient(this)
+            and potentially canceling the ResourceLoader, ensure it won't send resource load callbacks.
+        * loader/ResourceLoader.h:
+        (WebCore::ResourceLoader::setSendCallbackPolicy):
+
 2013-01-08  Alexandru Chiculita  <[email protected]>
 
         Assert in RenderGeometryMap::mapToContainer

Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (139149 => 139150)


--- trunk/Source/WebCore/loader/MainResourceLoader.cpp	2013-01-09 03:28:39 UTC (rev 139149)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp	2013-01-09 03:30:43 UTC (rev 139150)
@@ -181,7 +181,20 @@
     else if (m_substituteData.isValid()) {
         // A redirect resulted in loading substitute data.
         ASSERT(documentLoader()->timing()->redirectCount());
+
+        // We need to remove our reference to the CachedResource in favor of a SubstituteData load.
+        // This will probably trigger the cancellation of the CachedResource's underlying ResourceLoader, though there is a
+        // small chance that the resource is being loaded by a different Frame, preventing the ResourceLoader from being cancelled.
+        // If the ResourceLoader is indeed cancelled, it would normally send resource load callbacks.
+        // However, from an API perspective, this isn't a cancellation. Therefore, sever our relationship with the network load via clearResource(),
+        // but prevent the ResourceLoader from sending ResourceLoadNotifier callbacks.
+        RefPtr<ResourceLoader> resourceLoader = loader();
+        ASSERT(!resourceLoader || resourceLoader->shouldSendResourceLoadCallbacks());
+        if (resourceLoader)
+            resourceLoader->setSendCallbackPolicy(DoNotSendCallbacks);
         clearResource();
+        if (resourceLoader)
+            resourceLoader->setSendCallbackPolicy(SendCallbacks);
         handleSubstituteDataLoadSoon(request);
     }
 

Modified: trunk/Source/WebCore/loader/ResourceLoader.h (139149 => 139150)


--- trunk/Source/WebCore/loader/ResourceLoader.h	2013-01-09 03:28:39 UTC (rev 139149)
+++ trunk/Source/WebCore/loader/ResourceLoader.h	2013-01-09 03:30:43 UTC (rev 139150)
@@ -140,6 +140,7 @@
     const KURL& url() const { return m_request.url(); } 
     ResourceHandle* handle() const { return m_handle.get(); }
     bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbacks; }
+    void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.sendLoadCallbacks = sendLoadCallbacks; }
     bool shouldSniffContent() const { return m_options.sniffContent == SniffContent; }
 
     bool reachedTerminalState() const { return m_reachedTerminalState; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to