summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorkouhei@chromium.org <kouhei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-12 08:34:32 +0000
committerkouhei@chromium.org <kouhei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-12 08:34:32 +0000
commit62115ba4d4bbeadcd491cd3cfdacd292d4bf34f8 (patch)
tree7fd82b0275da316a879c452f588a882aea82c547 /extensions
parent89d7ec264e75863728bf25d21784c92939c9c52e (diff)
downloadchromium_src-62115ba4d4bbeadcd491cd3cfdacd292d4bf34f8.zip
chromium_src-62115ba4d4bbeadcd491cd3cfdacd292d4bf34f8.tar.gz
chromium_src-62115ba4d4bbeadcd491cd3cfdacd292d4bf34f8.tar.bz2
Call InitOriginPermissions when extension is added to the renderer process.
This is to fix permission breakage on extension background pages after blink patch r173044. Before this patch, permission settings were loaded on V8 context initialize. However, the blink patch deferred the V8 context initialize until its first use. This patch adds a call to |Dispatcher::InitOriginPermissions| on |Dispatcher::OnActivateExtension| which is called when render process for the extension is created. TEST=Manually confirmed that Files.app image viewer can load images on its first load. BUG=380346, 380502 Review URL: https://codereview.chromium.org/315143003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r--extensions/renderer/dispatcher.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 6098ee9..36134d8 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, which can't be
+ // initialized in |OnActivateExtension|.
+ if (context_type == Feature::CONTENT_SCRIPT_CONTEXT)
InitOriginPermissions(extension);
- }
{
scoped_ptr<ModuleSystem> module_system(
@@ -495,6 +496,8 @@ void Dispatcher::WebKitInitialized() {
++iter) {
const Extension* extension = extensions_.GetByID(*iter);
CHECK(extension);
+
+ InitOriginPermissions(extension);
}
EnableCustomElementWhiteList();
@@ -551,6 +554,8 @@ void Dispatcher::OnActivateExtension(const std::string& extension_id) {
if (is_webkit_initialized_) {
extensions::DOMActivityLogger::AttachToWorld(
extensions::DOMActivityLogger::kMainWorldId, extension_id);
+
+ InitOriginPermissions(extension);
}
UpdateActiveExtensions();