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

Unified Diff: extensions/renderer/user_script_set.cc

Issue 1293673002: Create thread-safe RendererExtensionRegistry from ExtensionSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « extensions/renderer/user_script_set.h ('k') | extensions/renderer/user_script_set_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/user_script_set.cc
diff --git a/extensions/renderer/user_script_set.cc b/extensions/renderer/user_script_set.cc
index 63634e0f04cfc919571deae1c22137374217b530..0cd225083878cd30e4da3ec5b5e27547716264bc 100644
--- a/extensions/renderer/user_script_set.cc
+++ b/extensions/renderer/user_script_set.cc
@@ -9,12 +9,12 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
#include "extensions/common/extension.h"
-#include "extensions/common/extension_set.h"
#include "extensions/common/extensions_client.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/renderer/extension_injection_host.h"
#include "extensions/renderer/extensions_renderer_client.h"
#include "extensions/renderer/injection_host.h"
+#include "extensions/renderer/renderer_extension_registry.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/script_injection.h"
#include "extensions/renderer/user_script_injector.h"
@@ -39,9 +39,7 @@ GURL GetDocumentUrlForFrame(blink::WebLocalFrame* frame) {
} // namespace
-UserScriptSet::UserScriptSet(const ExtensionSet* extensions)
- : extensions_(extensions) {
-}
+UserScriptSet::UserScriptSet() {}
UserScriptSet::~UserScriptSet() {
}
@@ -140,7 +138,8 @@ bool UserScriptSet::UpdateUserScripts(base::SharedMemoryHandle shared_memory,
if (only_inject_incognito && !script->is_incognito_enabled())
continue; // This script shouldn't run in an incognito tab.
- const Extension* extension = extensions_->GetByID(script->extension_id());
+ const Extension* extension =
+ RendererExtensionRegistry::Get()->GetByID(script->extension_id());
if (whitelisted_only &&
(!extension ||
!PermissionsData::CanExecuteScriptEverywhere(extension))) {
@@ -188,7 +187,7 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript(
const HostID& host_id = script->host_id();
if (host_id.type() == HostID::EXTENSIONS) {
- injection_host = ExtensionInjectionHost::Create(host_id.id(), extensions_);
+ injection_host = ExtensionInjectionHost::Create(host_id.id());
if (!injection_host)
return injection.Pass();
} else {
« no previous file with comments | « extensions/renderer/user_script_set.h ('k') | extensions/renderer/user_script_set_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698