Chromium Code Reviews| 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(); |