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

Unified Diff: extensions/renderer/dispatcher.cc

Issue 315143003: Call InitOriginPermissions when extension is added to the renderer process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avoid duplicated init Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/dispatcher.cc
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 71971591816fb86c06c8a44bc5cda5816f496628..666890475d9e73b7b4ca65fb5b95e2416c1b2462 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -258,9 +258,10 @@ void Dispatcher::DidCreateScriptContext(
.release();
script_context_set_.Add(context);
- if (extension) {
+ // Initialize origin permissions for content scripts.
+ // Skip active extensions which are already set up at |OnActivateExtension|.
+ if (!extension && IsExtensionActive(extension->id()))
not at google - send to devlin 2014/06/11 14:41:15 a better check here would be "context_type == Feat
kouhei (in TOK) 2014/06/12 01:07:38 Done.
InitOriginPermissions(extension);
- }
{
scoped_ptr<ModuleSystem> module_system(
@@ -496,6 +497,8 @@ void Dispatcher::WebKitInitialized() {
++iter) {
const Extension* extension = extensions_.GetByID(*iter);
CHECK(extension);
+
+ InitOriginPermissions(extension);
}
EnableCustomElementWhiteList();
@@ -552,6 +555,9 @@ void Dispatcher::OnActivateExtension(const std::string& extension_id) {
if (is_webkit_initialized_) {
extensions::DOMActivityLogger::AttachToWorld(
extensions::DOMActivityLogger::kMainWorldId, extension_id);
+
+ if (extension)
not at google - send to devlin 2014/06/11 14:41:15 there will always be an extension, because the CHE
kouhei (in TOK) 2014/06/12 01:07:38 Done.
+ InitOriginPermissions(extension);
}
UpdateActiveExtensions();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698