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

Unified Diff: chrome/common/extensions/extension_set.cc

Issue 10458063: Add sanbdoxed_pages to allow extension/app pages to be served in a sandboxed, unique origin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CheckCurrentContextAccessToExtensionAPI Created 8 years, 6 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/common/extensions/extension_set.cc
diff --git a/chrome/common/extensions/extension_set.cc b/chrome/common/extensions/extension_set.cc
index 1eb931cf5e66bb98bedc75189b9bbe61489eb51a..22f0ed22d1f81724be7da91523aa4c758ba8306c 100644
--- a/chrome/common/extensions/extension_set.cc
+++ b/chrome/common/extensions/extension_set.cc
@@ -128,7 +128,7 @@ const Extension* ExtensionSet::GetByID(const std::string& id) const {
bool ExtensionSet::ExtensionBindingsAllowed(
const ExtensionURLInfo& info) const {
- if (info.origin().isUnique())
+ if (info.origin().isUnique() || IsSandboxedPage(info))
return false;
if (info.url().SchemeIs(chrome::kExtensionScheme))
@@ -143,3 +143,16 @@ bool ExtensionSet::ExtensionBindingsAllowed(
return false;
}
+
+bool ExtensionSet::IsSandboxedPage(const ExtensionURLInfo& info) const {
+ if (info.origin().isUnique())
+ return true;
+
+ if (info.url().SchemeIs(chrome::kExtensionScheme)) {
+ const Extension* extension = GetByID(info.url().host());
+ if (extension) {
+ return extension->IsSandboxedPage(info.url().path());
+ }
+ }
+ return false;
+}

Powered by Google App Engine
This is Rietveld 408576698