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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 2546533007: Store the last committed origin in RenderFrameHostImpl. (Closed)
Patch Set: Rebase (and remove DCHECK) Created 4 years 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/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 44873594afe061d98414abd3f993b87c5ff7d9de..9d14f3417000c23886df9aa068235ae058c64eff 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -640,10 +640,12 @@ void NavigatorImpl::DidNavigate(
site_instance);
}
- // Keep track of each frame's URL in its FrameTreeNode, whether it's for a net
- // error or not.
- // TODO(creis): Move the last committed URL to RenderFrameHostImpl.
+ // Keep track of the last committed URL and origin in the RenderFrameHost
+ // itself. These allow GetLastCommittedURL and GetLastCommittedOrigin to
+ // stay correct even if the render_frame_host later becomes pending deletion.
+ // The URL is set regardless of whether it's for a net error or not.
render_frame_host->frame_tree_node()->SetCurrentURL(params.url);
+ render_frame_host->set_last_committed_origin(params.origin);
alexmos 2016/12/06 17:22:40 I originally tried to do this inside SetCurrentOri
Charlie Reis 2016/12/08 19:51:47 Interesting. Yes, I agree with your decisions.
// Separately, update the frame's last successful URL except for net error
// pages, since those do not end up in the correct process after transfers

Powered by Google App Engine
This is Rietveld 408576698