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

Unified Diff: chrome/renderer/extensions/extension_dispatcher.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: Don't inject bindings 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/renderer/extensions/extension_dispatcher.cc
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc
index 8226de81f55566ed5a7a4b22761903b17b629b15..c4bb06d8e4f610d23c504595fc33c03c3d87e136 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -896,6 +896,16 @@ Feature::Context ExtensionDispatcher::ClassifyJavaScriptContext(
if (extension_group == EXTENSION_GROUP_CONTENT_SCRIPTS)
return Feature::CONTENT_SCRIPT_CONTEXT;
+ // We have an explicit check for sandboxed pages first since:
Mihai Parparita -not on Chrome 2012/06/05 22:21:57 I ended up having to add this, since API bindings
+ // 1. Sandboxed pages run in the same process as regular extension pages, so
+ // the extension is considered active.
+ // 2. ScriptContext creation (which triggers bindings injection) happens
+ // before the SecurityContext is updated with the sandbox flags (after
+ // reading the CSP header), so url_info.url().securityOrigin() is not
+ // unique yet.
+ if (extensions_.IsSandboxedPage(url_info))
+ return Feature::WEB_PAGE_CONTEXT;
+
if (IsExtensionActive(extension_id))
return Feature::BLESSED_EXTENSION_CONTEXT;

Powered by Google App Engine
This is Rietveld 408576698