Title: [115223] trunk
Revision
115223
Author
[email protected]
Date
2012-04-25 10:12:20 -0700 (Wed, 25 Apr 2012)

Log Message

Source/WebCore: REGRESSION (r100311): YummySoup app crashes when trying to print
https://bugs.webkit.org/show_bug.cgi?id=83918

Reviewed by Alexey Proskuryakov.

Test: http/tests/xmlhttprequest/cancel-during-failure-crash.html

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didFail): Set m_calledDidFinishLoad when calling
   didFailToLoad() to prevent it from getting called twice if we cancel
   re-entrantly.

LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=83918.

Reviewed by Alexey Proskuryakov.

* http/tests/cache/cancel-during-failure-crash-expected.txt: Added.
* http/tests/cache/cancel-during-failure-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (115222 => 115223)


--- trunk/LayoutTests/ChangeLog	2012-04-25 17:04:04 UTC (rev 115222)
+++ trunk/LayoutTests/ChangeLog	2012-04-25 17:12:20 UTC (rev 115223)
@@ -1,3 +1,12 @@
+2012-04-25  Nate Chapin  <[email protected]>
+
+        Test for https://bugs.webkit.org/show_bug.cgi?id=83918.
+
+        Reviewed by Alexey Proskuryakov.
+
+        * http/tests/cache/cancel-during-failure-crash-expected.txt: Added.
+        * http/tests/cache/cancel-during-failure-crash.html: Added.
+
 2012-04-25  Sudarsana Nagineni  <[email protected]>
 
         [EFL] [DRT] LayoutTestController needs implementation of addOriginAccessWhitelistEntry and removeOriginAccessWhitelistEntry

Added: trunk/LayoutTests/http/tests/cache/cancel-during-failure-crash-expected.txt (0 => 115223)


--- trunk/LayoutTests/http/tests/cache/cancel-during-failure-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache/cancel-during-failure-crash-expected.txt	2012-04-25 17:12:20 UTC (rev 115223)
@@ -0,0 +1 @@
+PASS

Added: trunk/LayoutTests/http/tests/cache/cancel-during-failure-crash.html (0 => 115223)


--- trunk/LayoutTests/http/tests/cache/cancel-during-failure-crash.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache/cancel-during-failure-crash.html	2012-04-25 17:12:20 UTC (rev 115223)
@@ -0,0 +1,22 @@
+<html>
+<body>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+var img = new Image();
+img._onerror_ = function() {
+    // cancel resource load within didFail()
+    window.stop();
+    document.body.appendChild(document.createTextNode("PASS"));
+    layoutTestController.notifyDone();
+}
+
+// Port 7 will likely refuse the connection, causing a didFail()
+// from the network stack.
+img.src = ""
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (115222 => 115223)


--- trunk/Source/WebCore/ChangeLog	2012-04-25 17:04:04 UTC (rev 115222)
+++ trunk/Source/WebCore/ChangeLog	2012-04-25 17:12:20 UTC (rev 115223)
@@ -1,3 +1,17 @@
+2012-04-25  Nate Chapin  <[email protected]>
+
+        REGRESSION (r100311): YummySoup app crashes when trying to print
+        https://bugs.webkit.org/show_bug.cgi?id=83918
+
+        Reviewed by Alexey Proskuryakov.
+
+        Test: http/tests/xmlhttprequest/cancel-during-failure-crash.html
+
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::didFail): Set m_calledDidFinishLoad when calling
+           didFailToLoad() to prevent it from getting called twice if we cancel
+           re-entrantly.
+
 2012-04-25  Alexis Menard  <[email protected]>
 
         Not reviewed, fix Windows build after r115215.

Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (115222 => 115223)


--- trunk/Source/WebCore/loader/ResourceLoader.cpp	2012-04-25 17:04:04 UTC (rev 115222)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp	2012-04-25 17:12:20 UTC (rev 115223)
@@ -60,7 +60,7 @@
     , m_reachedTerminalState(false)
     , m_calledWillCancel(false)
     , m_cancelled(false)
-    , m_calledDidFinishLoad(false)
+    , m_notifiedLoadComplete(false)
     , m_defersLoading(frame->page()->defersLoading())
     , m_options(options)
 {
@@ -304,9 +304,9 @@
         return;
     ASSERT(!m_reachedTerminalState);
 
-    if (m_calledDidFinishLoad)
+    if (m_notifiedLoadComplete)
         return;
-    m_calledDidFinishLoad = true;
+    m_notifiedLoadComplete = true;
     if (m_options.sendLoadCallbacks == SendCallbacks)
         frameLoader()->notifier()->didFinishLoad(this, finishTime);
 }
@@ -324,8 +324,11 @@
     if (FormData* data = ""
         data->removeGeneratedFilesIfNeeded();
 
-    if (m_options.sendLoadCallbacks == SendCallbacks && !m_calledDidFinishLoad)
-        frameLoader()->notifier()->didFailToLoad(this, error);
+    if (!m_notifiedLoadComplete) {
+        m_notifiedLoadComplete = true;
+        if (m_options.sendLoadCallbacks == SendCallbacks)
+            frameLoader()->notifier()->didFailToLoad(this, error);
+    }
 
     releaseResources();
 }
@@ -372,7 +375,7 @@
             m_handle = 0;
         }
 
-        if (m_options.sendLoadCallbacks == SendCallbacks && m_identifier && !m_calledDidFinishLoad)
+        if (m_options.sendLoadCallbacks == SendCallbacks && m_identifier && !m_notifiedLoadComplete)
             frameLoader()->notifier()->didFailToLoad(this, nonNullError);
     }
 

Modified: trunk/Source/WebCore/loader/ResourceLoader.h (115222 => 115223)


--- trunk/Source/WebCore/loader/ResourceLoader.h	2012-04-25 17:04:04 UTC (rev 115222)
+++ trunk/Source/WebCore/loader/ResourceLoader.h	2012-04-25 17:12:20 UTC (rev 115223)
@@ -177,7 +177,7 @@
         bool m_reachedTerminalState;
         bool m_calledWillCancel;
         bool m_cancelled;
-        bool m_calledDidFinishLoad;
+        bool m_notifiedLoadComplete;
 
         bool m_defersLoading;
         ResourceRequest m_deferredRequest;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to