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

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: Alexmos's fixes. 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 4a016945ec23b1bf395fbb8ff3b46823ca0ce1a9..ec98d5e4681caf22f56ed61256a51ec939cca921 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -313,6 +313,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();
Charlie Reis 2015/11/24 21:00:42 Sanity check: Since there aren't callers yet, do w
ncarter (slow) 2015/11/24 22:07:33 Switched to a CHECK based on our face-to-face disc
+ }
+ return frame_tree_node_->current_origin();
+}
+
gfx::NativeView RenderFrameHostImpl::GetNativeView() {
RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView();
if (!view)

Powered by Google App Engine
This is Rietveld 408576698