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

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: address comments 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..2ffd8bb73e9c574c2843fd920a27055c7215b4a8 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(
@@ -496,6 +497,8 @@ void Dispatcher::WebKitInitialized() {
++iter) {
const Extension* extension = extensions_.GetByID(*iter);
CHECK(extension);
+
+ InitOriginPermissions(extension);
}
EnableCustomElementWhiteList();
@@ -552,6 +555,8 @@ void Dispatcher::OnActivateExtension(const std::string& extension_id) {
if (is_webkit_initialized_) {
extensions::DOMActivityLogger::AttachToWorld(
extensions::DOMActivityLogger::kMainWorldId, extension_id);
+
+ 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