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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1422333009: OOPIF: History navigations for new child frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment 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: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index d07cd18ee0890e5cd2dc048d542f6d8eabdd3eef..61a0485d9479e0fcb2d5f0b0baa038dfcc4cbb68 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2535,14 +2535,22 @@ void RenderFrameImpl::loadURLExternally(const blink::WebURLRequest& request,
}
blink::WebHistoryItem RenderFrameImpl::historyItemForNewChildFrame(
- blink::WebFrame* frame) {
- DCHECK(!frame_ || frame_ == frame);
+ bool* should_load_request) {
- // TODO(creis): In OOPIF enabled modes, send an IPC to the browser process
- // telling it to navigate the new frame. See https://crbug.com/502317.
- if (SiteIsolationPolicy::UseSubframeNavigationEntries())
+ // In OOPIF enabled modes, send an IPC to the browser process telling it to
+ // navigate the new frame.
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
+ std::string unique_name = frame_->uniqueName().utf8();
+ // TODO(creis): Have the browser tell the renderer process which names it
+ // has history items for. In that case, set should_load_request to true and
+ // return an empty WebHistoryItem so that Blink loads the default.
+ // See https://crbug.com/502317.
+ *should_load_request = false;
+ Send(new FrameHostMsg_NavigateNewChildFrame(routing_id_, unique_name));
return WebHistoryItem();
+ }
+ *should_load_request = true;
return render_view_->history_controller()->GetItemForNewChildFrame(this);
}
@@ -4770,6 +4778,8 @@ void RenderFrameImpl::NavigateInternal(
: blink::WebHistoryDifferentDocumentLoad;
// Navigate the frame directly.
+ // TODO(creis): Use InitialHistoryLoad rather than BackForward for a
+ // history navigation in a newly created subframe.
WebURLRequest request =
frame_->requestFromHistoryItem(history_item, cache_policy);
frame_->load(request, blink::WebFrameLoadType::BackForward,

Powered by Google App Engine
This is Rietveld 408576698