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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1422333009: OOPIF: History navigations for new child frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better DidStartLoading fix, disable restore test Created 5 years, 1 month 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
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index d0e9bbb04981714c12a5a1f00027e51b88fbea6a..47c6e0fd16326c40f49bdcec9b28c681cb76d1cf 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -146,6 +146,7 @@
#include "core/loader/HistoryItem.h"
#include "core/loader/MixedContentChecker.h"
#include "core/loader/NavigationScheduler.h"
+#include "core/loader/ProgressTracker.h"
#include "core/page/FocusController.h"
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
@@ -1757,10 +1758,19 @@ PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra
return nullptr;
// If we're moving in the back/forward list, we might want to replace the content
- // of this child frame with whatever was there at that point.
+ // of this child frame with whatever was there at that point. The client may want
+ // to do this asynchronously, in which case shouldLoadRequest will be set to false.
+ bool shouldLoadRequest = true;
RefPtrWillBeRawPtr<HistoryItem> childItem = nullptr;
- if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->document()->loadEventFinished())
- childItem = PassRefPtrWillBeRawPtr<HistoryItem>(webframeChild->client()->historyItemForNewChildFrame(webframeChild));
+ if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->document()->loadEventFinished()) {
+ childItem = PassRefPtrWillBeRawPtr<HistoryItem>(webframeChild->client()->historyItemForNewChildFrame(&shouldLoadRequest));
+ if (!shouldLoadRequest) {
+ // The load will start in the browser process, so let the progress tracker
+ // know about it.
+ child->loader().progress().progressStarted();
+ return child;
+ }
+ }
FrameLoadRequest newRequest = request;
FrameLoadType loadType = FrameLoadTypeStandard;
@@ -1992,9 +2002,9 @@ void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra
OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nullptr, SandboxNone, WebFrameOwnerProperties());
RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClientImpl.get(), oldFrame->host(), tempOwner.get());
frame->setOwner(oldFrame->owner());
- frame->tree().setName(name);
setParent(oldWebFrame->parent());
setOpener(oldWebFrame->opener());
+ frame->tree().setName(name);
Charlie Reis 2015/11/23 22:56:36 This will go away when Daniel fixes unique names w
setCoreFrame(frame);
if (frame->owner() && !frame->owner()->isLocal()) {

Powered by Google App Engine
This is Rietveld 408576698