Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 1058403002: Revert of Refactor frame navigation/detach state cleanup to be more sane. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/DocumentLoader.cpp ('k') | Source/core/testing/DummyPageHolder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index cf9ee0a7283704a14ea3dab8eaebdd190b37249a..922fb8214a549fff262e326be04cf7f61258e42b 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -242,6 +242,7 @@
m_frame->editor().clear();
m_frame->document()->cancelParsing();
+ m_frame->document()->prepareForDestruction();
m_frame->document()->removeFocusedElementOfSubtree(m_frame->document());
m_frame->selection().prepareForDestruction();
m_frame->eventHandler().clear();
@@ -278,11 +279,9 @@
init.withNewRegistrationContext();
stopAllLoaders();
- m_frame->detachChildren();
- m_frame->document()->prepareForDestruction();
clear();
- // detachChildren() potentially detaches the frame from the document. The
+ // clear() potentially detaches the frame from the document. The
// loading cannot continue in that case.
if (!m_frame->page())
return;
@@ -965,19 +964,12 @@
client()->dispatchWillClose();
dispatchUnloadEvent();
}
+ m_frame->detachChildren();
if (pdl != m_provisionalDocumentLoader)
return;
if (m_documentLoader)
m_documentLoader->detachFromFrame();
m_documentLoader = m_provisionalDocumentLoader.release();
- if (m_frame->document()) {
- // Note that calling detachChildren() shouldn't be needed if there's no
- // Document, since no child frames should be attached. The assert below
- // enforces this invariant.
- m_frame->detachChildren();
- m_frame->document()->prepareForDestruction();
- }
- ASSERT(m_frame->tree().childCount() == 0);
if (isLoadingMainFrame())
m_frame->page()->chrome().client().needTouchEvents(false);
« no previous file with comments | « Source/core/loader/DocumentLoader.cpp ('k') | Source/core/testing/DummyPageHolder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698