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

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

Issue 1475433002: Expose RenderFrameHost::GetLastCommittedOrigin(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 9a8810b3aa9a45c2ec8424f30fbbff6800fe5421..4eeda768c6c22ee0542e6c43d466e9f8563697f2 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -311,6 +311,15 @@ GURL RenderFrameHostImpl::GetLastCommittedURL() {
return frame_tree_node_->current_url();
}
+url::Origin RenderFrameHostImpl::GetLastCommittedOrigin() {
+ // Origin is stored per-FTN, so it's incorrect to call for a non-current RFH.
+ if (this != frame_tree_node_->current_frame_host()) {
+ NOTREACHED() << "Origin information is tracked only for the current host.";
+ return url::Origin();
+ }
+ return frame_tree_node_->current_replication_state().origin;
alexmos 2015/11/24 00:05:49 We can now just do frame_tree_node_->current_origi
ncarter (slow) 2015/11/24 00:35:33 Will do.
+}
+
gfx::NativeView RenderFrameHostImpl::GetNativeView() {
RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView();
if (!view)

Powered by Google App Engine
This is Rietveld 408576698