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

Unified Diff: content/public/browser/render_frame_host.h

Issue 1475433002: Expose RenderFrameHost::GetLastCommittedOrigin(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Charlie'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
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/test/data/frame_tree/top.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/render_frame_host.h
diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h
index d26ec27c1972b2f843215726ec91809707fb7250..0fcb180954337def1462781c229008164f893aa7 100644
--- a/content/public/browser/render_frame_host.h
+++ b/content/public/browser/render_frame_host.h
@@ -16,6 +16,7 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/native_widget_types.h"
#include "url/gurl.h"
+#include "url/origin.h"
namespace base {
class Value;
@@ -76,8 +77,23 @@ class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
virtual bool IsCrossProcessSubframe() = 0;
// Returns the last committed URL of the frame.
+ //
+ // The URL is only accurate if this RenderFrameHost is current in the frame
+ // tree -- i.e., it would be visited by WebContents::ForEachFrame. In
+ // particular, this method may return a misleading value if called from
+ // WebContentsObserver::RenderFrameCreated, since non-current frames can be
+ // passed to that observer method.
virtual GURL GetLastCommittedURL() = 0;
+ // Returns the last committed origin of the frame.
+ //
+ // The origin is only available if this RenderFrameHost is current in the
+ // frame tree -- i.e., it would be visited by WebContents::ForEachFrame. In
+ // particular, this method may CHECK if called from
+ // WebContentsObserver::RenderFrameCreated, since non-current frames can be
+ // passed to that observer method.
+ virtual url::Origin GetLastCommittedOrigin() = 0;
+
// Returns the associated widget's native view.
virtual gfx::NativeView GetNativeView() = 0;
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/test/data/frame_tree/top.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698