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

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

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/render_frame_host_impl.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index 0d5628798eb26c4c56a43b2fe1323f273e21f6fb..424dbc69da07f2fcbd220bc703d93c22837cd8cd 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -135,7 +135,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
const std::string& GetFrameName() override;
bool IsCrossProcessSubframe() override;
const GURL& GetLastCommittedURL() override;
- url::Origin GetLastCommittedOrigin() override;
+ const url::Origin& GetLastCommittedOrigin() override;
Charlie Reis 2016/12/08 19:51:47 Good catch.
gfx::NativeView GetNativeView() override;
void AddMessageToConsole(ConsoleMessageLevel level,
const std::string& message) override;
@@ -240,6 +240,11 @@ class CONTENT_EXPORT RenderFrameHostImpl
last_successful_url_ = url;
}
+ // Update this frame's last committed origin.
+ void set_last_committed_origin(const url::Origin& origin) {
+ last_committed_origin_ = origin;
+ }
+
// Returns the associated WebUI or null if none applies.
WebUIImpl* web_ui() const { return web_ui_.get(); }
@@ -607,6 +612,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
UnloadPushStateOnCrossProcessNavigation);
FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest,
WebUIJavascriptDisallowedAfterSwapOut);
+ FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, LastCommittedOrigin);
FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, CrashSubframe);
FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
RenderViewHostIsNotReusedAfterDelayedSwapOutACK);
@@ -878,6 +884,9 @@ class CONTENT_EXPORT RenderFrameHostImpl
// Track this frame's last committed URL.
GURL last_committed_url_;
+ // Track this frame's last committed origin.
+ url::Origin last_committed_origin_;
+
// The most recent non-error URL to commit in this frame. Remove this in
// favor of GetLastCommittedURL() once PlzNavigate is enabled or cross-process
// transfers work for net errors. See https://crbug.com/588314.

Powered by Google App Engine
This is Rietveld 408576698