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

Unified Diff: content/test/web_contents_observer_sanity_checker.cc

Issue 1495993002: Enforce all subframes to be in the same BrowsingInstance as the parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on Charlie's review. Created 5 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/web_contents_observer_sanity_checker.cc
diff --git a/content/test/web_contents_observer_sanity_checker.cc b/content/test/web_contents_observer_sanity_checker.cc
index a27c96b3ac16ba636529829552bea3589e59eec2..ce22bedd7038e8cec3a2594d0d70cc6b0bcc48bd 100644
--- a/content/test/web_contents_observer_sanity_checker.cc
+++ b/content/test/web_contents_observer_sanity_checker.cc
@@ -54,6 +54,12 @@ void WebContentsObserverSanityChecker::RenderFrameCreated(
static_cast<RenderFrameHostImpl*>(render_frame_host)->IsRenderFrameLive())
<< "RenderFrameCreated called on for a RenderFrameHost that thinks it is "
"not alive.";
+
+ // Any child frame must be in the same BrowsingInstance as its parent.
+ if (render_frame_host->GetParent()) {
+ CHECK(render_frame_host->GetSiteInstance()->IsRelatedSiteInstance(
+ render_frame_host->GetParent()->GetSiteInstance()));
+ }
}
void WebContentsObserverSanityChecker::RenderFrameDeleted(
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698