Title: [187832] releases/WebKitGTK/webkit-2.8/Source/WebCore
- Revision
- 187832
- Author
- [email protected]
- Date
- 2015-08-04 02:45:11 -0700 (Tue, 04 Aug 2015)
Log Message
Merge r186642, r186677 - DocumentLoader::detachFromFrame() is being called with no current Frame set.
<rdar://problem/21293082> and https://bugs.webkit.org/show_bug.cgi?id=146786
Reviewed by Sam Weinig.
No new tests (Unknown how to reproduce).
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::attachToFrame):
(WebCore::DocumentLoader::detachFromFrame): Null check m_frame before dereferencing it.
(WebCore::DocumentLoader::setFrame): Deleted, renamed to attachToFrame(), and take's
a Frame& instead of a Frame*.
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::initForSynthesizedDocument): setFrame is now attachToFrame.
(WebCore::FrameLoader::setPolicyDocumentLoader): Ditto.
(WebCore::FrameLoader::transitionToCommitted): Ditto.
ASSERT restoring from page cache as DocumentLoader reattaches to its Frame.
<rdar://problem/21766282> and https://bugs.webkit.org/show_bug.cgi?id=146786
Reviewed by NOBODY (Fixing obvious boneheaded mistake in r186642)
No new tests (Covered by existing)
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::attachToFrame): Bail if reattaching to the current Frame,
which happens when restoring from the page cache.
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (187831 => 187832)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-08-04 09:40:08 UTC (rev 187831)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-08-04 09:45:11 UTC (rev 187832)
@@ -1,3 +1,37 @@
+2015-07-10 Brady Eidson <[email protected]>
+
+ ASSERT restoring from page cache as DocumentLoader reattaches to its Frame.
+ <rdar://problem/21766282> and https://bugs.webkit.org/show_bug.cgi?id=146786
+
+ Reviewed by NOBODY (Fixing obvious boneheaded mistake in r186642)
+
+ No new tests (Covered by existing)
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::attachToFrame): Bail if reattaching to the current Frame,
+ which happens when restoring from the page cache.
+
+2015-07-09 Brady Eidson <[email protected]>
+
+ DocumentLoader::detachFromFrame() is being called with no current Frame set.
+ <rdar://problem/21293082> and https://bugs.webkit.org/show_bug.cgi?id=146786
+
+ Reviewed by Sam Weinig.
+
+ No new tests (Unknown how to reproduce).
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::attachToFrame):
+ (WebCore::DocumentLoader::detachFromFrame): Null check m_frame before dereferencing it.
+ (WebCore::DocumentLoader::setFrame): Deleted, renamed to attachToFrame(), and take's
+ a Frame& instead of a Frame*.
+ * loader/DocumentLoader.h:
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::initForSynthesizedDocument): setFrame is now attachToFrame.
+ (WebCore::FrameLoader::setPolicyDocumentLoader): Ditto.
+ (WebCore::FrameLoader::transitionToCommitted): Ditto.
+
2015-07-09 Darin Adler <[email protected]>
REGRESSION (r182866): repeated prompts for password on internal Apple website using workers
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/DocumentLoader.cpp (187831 => 187832)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/DocumentLoader.cpp 2015-08-04 09:40:08 UTC (rev 187831)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/DocumentLoader.cpp 2015-08-04 09:45:11 UTC (rev 187832)
@@ -922,13 +922,14 @@
m_frame->document()->domWindow()->finishedLoading();
}
-void DocumentLoader::setFrame(Frame* frame)
+void DocumentLoader::attachToFrame(Frame& frame)
{
- if (m_frame == frame)
+ if (m_frame == &frame)
return;
- ASSERT(frame && !m_frame);
- m_frame = frame;
- m_writer.setFrame(frame);
+
+ ASSERT(!m_frame);
+ m_frame = &frame;
+ m_writer.setFrame(&frame);
attachToFrame();
}
@@ -950,7 +951,14 @@
m_mainResource->removeClient(this);
m_applicationCacheHost->setDOMApplicationCache(nullptr);
- InspectorInstrumentation::loaderDetachedFromFrame(*m_frame, *this);
+
+ // Even though we ASSERT at the top of this method that we have an m_frame, we're seeing crashes where m_frame is null.
+ // This means either that a DocumentLoader is detaching twice, or is detaching before ever having attached.
+ // Until we figure out how that is happening, null check m_frame before dereferencing it here.
+ // <rdar://problem/21293082> and https://bugs.webkit.org/show_bug.cgi?id=146786
+ if (m_frame)
+ InspectorInstrumentation::loaderDetachedFromFrame(*m_frame, *this);
+
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.");
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/DocumentLoader.h (187831 => 187832)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/DocumentLoader.h 2015-08-04 09:40:08 UTC (rev 187831)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/DocumentLoader.h 2015-08-04 09:45:11 UTC (rev 187832)
@@ -84,10 +84,9 @@
}
WEBCORE_EXPORT virtual ~DocumentLoader();
- WEBCORE_EXPORT void setFrame(Frame*);
+ void attachToFrame(Frame&);
Frame* frame() const { return m_frame; }
- WEBCORE_EXPORT virtual void attachToFrame();
WEBCORE_EXPORT virtual void detachFromFrame();
WEBCORE_EXPORT FrameLoader* frameLoader() const;
@@ -270,6 +269,8 @@
protected:
WEBCORE_EXPORT DocumentLoader(const ResourceRequest&, const SubstituteData&);
+ WEBCORE_EXPORT virtual void attachToFrame();
+
bool m_deferMainResourceDataLoad;
private:
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/FrameLoader.cpp (187831 => 187832)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/FrameLoader.cpp 2015-08-04 09:40:08 UTC (rev 187831)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/FrameLoader.cpp 2015-08-04 09:45:11 UTC (rev 187832)
@@ -274,7 +274,7 @@
// FrameLoader::checkCompleted() will overwrite the URL of the document to be activeDocumentLoader()->documentURL().
RefPtr<DocumentLoader> loader = m_client.createDocumentLoader(ResourceRequest(URL(ParsedURLString, emptyString())), SubstituteData());
- loader->setFrame(&m_frame);
+ loader->attachToFrame(m_frame);
loader->setResponse(ResourceResponse(URL(), ASCIILiteral("text/html"), 0, String()));
loader->setCommitted(true);
setDocumentLoader(loader.get());
@@ -1685,7 +1685,7 @@
return;
if (loader)
- loader->setFrame(&m_frame);
+ loader->attachToFrame(m_frame);
if (m_policyDocumentLoader
&& m_policyDocumentLoader != m_provisionalDocumentLoader
&& m_policyDocumentLoader != m_documentLoader)
@@ -1925,7 +1925,7 @@
if (cachedPage) {
DocumentLoader* cachedDocumentLoader = cachedPage->documentLoader();
ASSERT(cachedDocumentLoader);
- cachedDocumentLoader->setFrame(&m_frame);
+ cachedDocumentLoader->attachToFrame(m_frame);
m_client.transitionToCommittedFromCachedFrame(cachedPage->cachedMainFrame());
} else
m_client.transitionToCommittedForNewPage();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes