Title: [179895] trunk/Source/WebCore
Revision
179895
Author
[email protected]
Date
2015-02-10 15:59:09 -0800 (Tue, 10 Feb 2015)

Log Message

Add another assertion to help track down crash in DocumentLoader::stopLoadingForPolicyChange()
https://bugs.webkit.org/show_bug.cgi?id=141447
<rdar://problem/13811738>

Reviewed by Alexey Proskuryakov.

Add another assertion to help track down crash in
DocumentLoader::stopLoadingForPolicyChange().

The trace seems to hint that frameLoader() returns null when
stopLoadingForPolicyChange() is called. frameLoader() can only return
null after DocumentLoader::detachFromFrame() has been called.
Also, stopLoadingForPolicyChange() here is called from the
DocumentLoader::continueAfterContentPolicy() policy callback which
requires m_waitingForContentPolicy to be true. Therefore, we should
assert that m_waitingForContentPolicy is false when m_frame is cleared
in DocumentLoader::detachFromFrame().

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (179894 => 179895)


--- trunk/Source/WebCore/ChangeLog	2015-02-10 23:52:11 UTC (rev 179894)
+++ trunk/Source/WebCore/ChangeLog	2015-02-10 23:59:09 UTC (rev 179895)
@@ -1,3 +1,26 @@
+2015-02-10  Chris Dumez  <[email protected]>
+
+        Add another assertion to help track down crash in DocumentLoader::stopLoadingForPolicyChange()
+        https://bugs.webkit.org/show_bug.cgi?id=141447
+        <rdar://problem/13811738>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add another assertion to help track down crash in
+        DocumentLoader::stopLoadingForPolicyChange().
+
+        The trace seems to hint that frameLoader() returns null when
+        stopLoadingForPolicyChange() is called. frameLoader() can only return
+        null after DocumentLoader::detachFromFrame() has been called.
+        Also, stopLoadingForPolicyChange() here is called from the
+        DocumentLoader::continueAfterContentPolicy() policy callback which
+        requires m_waitingForContentPolicy to be true. Therefore, we should
+        assert that m_waitingForContentPolicy is false when m_frame is cleared
+        in DocumentLoader::detachFromFrame().
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::detachFromFrame):
+
 2015-02-10  Alex Christensen  <[email protected]>
 
         Add more WEBCORE_EXPORT macros for iOS.

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (179894 => 179895)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2015-02-10 23:52:11 UTC (rev 179894)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2015-02-10 23:59:09 UTC (rev 179895)
@@ -948,9 +948,11 @@
     if (m_mainResource && m_mainResource->hasClient(this))
         m_mainResource->removeClient(this);
 
-    m_applicationCacheHost->setDOMApplicationCache(0);
+    m_applicationCacheHost->setDOMApplicationCache(nullptr);
     InspectorInstrumentation::loaderDetachedFromFrame(*m_frame, *this);
-    m_frame = 0;
+    m_frame = nullptr;
+    // The call to stopLoading() above should have canceled any pending content policy check.
+    ASSERT_WITH_MESSAGE(!m_waitingForContentPolicy, "The content policy callback needs a valid frame.");
 }
 
 void DocumentLoader::clearMainResourceLoader()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to