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

Unified Diff: chrome/browser/extensions/chrome_content_browser_client_extensions_part.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: chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
index 6254ba8daf289d352c138e0a77a963a5b8f779e5..0628a00d9aa2db06a0f0558dd3010f24ee957cd9 100644
--- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
+++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc
@@ -6,7 +6,10 @@
#include <stddef.h>
+#include <memory>
#include <set>
+#include <string>
+#include <vector>
#include "base/command_line.h"
#include "base/debug/alias.h"
@@ -684,14 +687,14 @@ ChromeContentBrowserClientExtensionsPart::GetVpnServiceProxy(
// static
bool ChromeContentBrowserClientExtensionsPart::
- ShouldFrameShareParentSiteInstanceDespiteTopDocumentIsolation(
- const GURL& subframe_url,
- content::SiteInstance* parent_site_instance) {
+ IsMainFrameSiteInstanceExcludedFromTopDocumentIsolation(
+ content::SiteInstance* main_frame_site_instance) {
+ // Disable TDI if the main frame's SiteInstance is a hosted app.
+ // See also https://crbug.com/679011.
const Extension* extension =
- ExtensionRegistry::Get(parent_site_instance->GetBrowserContext())
+ ExtensionRegistry::Get(main_frame_site_instance->GetBrowserContext())
->enabled_extensions()
- .GetExtensionOrAppByURL(parent_site_instance->GetSiteURL());
-
+ .GetExtensionOrAppByURL(main_frame_site_instance->GetSiteURL());
return extension && extension->is_hosted_app();
}

Powered by Google App Engine
This is Rietveld 408576698