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

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

Issue 2946113002: Use FrameIsAd to decide whether to isolate a frame in TopDocumentIsolation mode. (Closed)
Patch Set: Addressing CR feedback from jkarlin@ and creis@. Created 3 years, 5 months 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_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index af7ba906a7c3f8bf037204bf2b2fd1ef813b9836..c8b4275d5537de424b021c6173c1df17442e49bf 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -987,9 +987,9 @@ void RenderFrameHostManager::RenderProcessGone(SiteInstanceImpl* instance) {
void RenderFrameHostManager::CancelPendingIfNecessary(
RenderFrameHostImpl* render_frame_host) {
- if (render_frame_host == pending_render_frame_host_.get())
+ if (render_frame_host == pending_render_frame_host_.get()) {
CancelPending();
- else if (render_frame_host == speculative_render_frame_host_.get()) {
+ } else if (render_frame_host == speculative_render_frame_host_.get()) {
// TODO(nasko, clamy): This should just clean up the speculative RFH
// without canceling the request. See https://crbug.com/636119.
if (frame_tree_node_->navigation_request() &&
@@ -1434,18 +1434,20 @@ RenderFrameHostManager::DetermineSiteInstanceForURL(
SiteIsolationPolicy::IsTopDocumentIsolationEnabled() &&
!SiteInstanceImpl::DoesSiteRequireDedicatedProcess(browser_context,
dest_url)) {
+ RenderFrameHostImpl* main_frame =
+ frame_tree_node_->frame_tree()->root()->current_frame_host();
if (GetContentClient()
->browser()
- ->ShouldFrameShareParentSiteInstanceDespiteTopDocumentIsolation(
- dest_url, current_instance)) {
- return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance());
+ ->ShouldIsolateFrameForTopDocumentIsolation(
+ transfer_navigation_handle_.get(),
+ main_frame->GetSiteInstance())) {
+ // This is a cross-site subframe of a non-isolated origin, so place this
+ // frame in the default subframe site instance.
+ return SiteInstanceDescriptor(
+ browser_context, dest_url,
+ SiteInstanceRelation::RELATED_DEFAULT_SUBFRAME);
}
-
- // This is a cross-site subframe of a non-isolated origin, so place this
- // frame in the default subframe site instance.
- return SiteInstanceDescriptor(
- browser_context, dest_url,
- SiteInstanceRelation::RELATED_DEFAULT_SUBFRAME);
+ return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance());
}
// Keep subframes in the parent's SiteInstance unless a dedicated process is
« no previous file with comments | « chrome/browser/ui/extensions/hosted_app_browsertest.cc ('k') | content/browser/top_document_isolation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698