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

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

Issue 1177333002: Revert of Detach old frame on WebFrame::swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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/FrameLoader.h ('k') | Source/core/page/Page.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 edc0995435aa4d3be0d35ced09faadd46447fcdb..95e6a1f13e495bad5e53f3d61d64e055a17dcf4f 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -1000,10 +1000,18 @@
}
}
-bool FrameLoader::prepareForCommit()
-{
+void FrameLoader::commitProvisionalLoad()
+{
+ ASSERT(client()->hasWebView());
PluginScriptForbiddenScope forbidPluginDestructorScripting;
RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
+ RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get());
+
+ // Check if the destination page is allowed to access the previous page's timing information.
+ if (m_frame->document()) {
+ RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(pdl->request().url());
+ pdl->timing().setHasSameOriginAsPreviousDocument(securityOrigin->canRequest(m_frame->document()->url()));
+ }
if (m_documentLoader) {
client()->dispatchWillClose();
@@ -1015,7 +1023,7 @@
// script intiates a new load or causes the current frame to be detached,
// we need to abandon the current load.
if (pdl != m_provisionalDocumentLoader)
- return false;
+ return;
if (m_documentLoader) {
FrameNavigationDisabler navigationDisabler(m_frame);
m_documentLoader->detachFromFrame();
@@ -1026,28 +1034,11 @@
// TODO(dcheng): Investigate if this can be moved above the check that
// m_provisionalDocumentLoader hasn't changed.
if (!m_frame->client())
- return false;
+ return;
// No more events will be dispatched so detach the Document.
if (m_frame->document())
m_frame->document()->detach();
m_documentLoader = m_provisionalDocumentLoader.release();
-
- return true;
-}
-
-void FrameLoader::commitProvisionalLoad()
-{
- ASSERT(client()->hasWebView());
- RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get());
-
- // Check if the destination page is allowed to access the previous page's timing information.
- if (m_frame->document()) {
- RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(m_provisionalDocumentLoader->request().url());
- m_provisionalDocumentLoader->timing().setHasSameOriginAsPreviousDocument(securityOrigin->canRequest(m_frame->document()->url()));
- }
-
- if (!prepareForCommit())
- return;
if (isLoadingMainFrame())
m_frame->page()->chromeClient().needTouchEvents(false);
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698