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

Unified Diff: Source/core/frame/LocalFrame.cpp

Issue 1152053006: Allow RemoteFrames to be navigated through targeted navigation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add Frame::navigate method that takes FrameLoadRequest param. 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
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index c2c67c5d0a68af2a1f03461d05f35ea5b2f29b9f..838e923e56af641e065bdde37bd430ec3e228ca9 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -251,6 +251,22 @@ void LocalFrame::navigate(Document& originDocument, const KURL& url, bool lockBa
}
}
+void LocalFrame::navigate(const FrameLoadRequest& request)
+{
+ // TODO(dcheng): Special case for window.open("about:blank") to ensure it loads synchronously into
Nate Chapin 2015/06/08 16:56:22 I don't love the duplication here. Perhaps we shou
nasko 2015/06/08 17:27:04 Yeah, not a big fan either. I've modified it as su
+ // a new window. This is our historical behavior, and it's consistent with the creation of
+ // a new iframe with src="about:blank". Perhaps we could get rid of this if we started reporting
+ // the initial empty document's url as about:blank? See crbug.com/471239.
+ // TODO(japhet): This special case is also necessary for behavior asserted by some extensions tests.
+ // Using NavigationScheduler::scheduleNavigationChange causes the navigation to be flagged as a
+ // client redirect, which is observable via the webNavigation extension api.
+ if (isMainFrame() && !m_loader.stateMachine()->committedFirstRealDocumentLoad()) {
+ m_loader.load(request);
+ } else {
+ m_navigationScheduler.scheduleLocationChange(request.originDocument(), request.resourceRequest().url(), request.lockBackForwardList());
+ }
+}
+
void LocalFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientRedirectPolicy)
{
ASSERT(clientRedirectPolicy == NotClientRedirect || reloadPolicy == NormalReload);

Powered by Google App Engine
This is Rietveld 408576698