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

Unified Diff: extensions/renderer/user_script_injector.cc

Issue 988633003: Refactoring: de-couple Extensions from "script injection System" [render side]:4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 9 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_injector.h ('k') | extensions/renderer/user_script_set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/user_script_injector.cc
diff --git a/extensions/renderer/user_script_injector.cc b/extensions/renderer/user_script_injector.cc
index dc4d06a694168a4d18c06d906b9304690d237f04..5a42ffa71b03f1a26c0d1fda54ff0427c341471c 100644
--- a/extensions/renderer/user_script_injector.cc
+++ b/extensions/renderer/user_script_injector.cc
@@ -56,13 +56,12 @@ base::LazyInstance<GreasemonkeyApiJsString> g_greasemonkey_api =
} // namespace
-UserScriptInjector::UserScriptInjector(
- const UserScript* script,
- UserScriptSet* script_list,
- bool is_declarative)
+UserScriptInjector::UserScriptInjector(const UserScript* script,
+ UserScriptSet* script_list,
+ bool is_declarative)
: script_(script),
script_id_(script_->id()),
- extension_id_(script_->extension_id()),
+ host_id_(script_->host_id()),
is_declarative_(is_declarative),
user_script_set_observer_(this) {
user_script_set_observer_.Add(script_list);
@@ -72,11 +71,11 @@ UserScriptInjector::~UserScriptInjector() {
}
void UserScriptInjector::OnUserScriptsUpdated(
- const std::set<std::string>& changed_extensions,
+ const std::set<HostID>& changed_hosts,
const std::vector<UserScript*>& scripts) {
- // If the extension causing this injection changed, then this injection
+ // If the host causing this injection changed, then this injection
// will be removed, and there's no guarantee the backing script still exists.
- if (changed_extensions.count(extension_id_) > 0)
+ if (changed_hosts.count(host_id_) > 0)
return;
for (std::vector<UserScript*>::const_iterator iter = scripts.begin();
@@ -202,7 +201,7 @@ void UserScriptInjector::GetRunInfo(
for (UserScript::FileList::const_iterator iter = js_scripts.begin();
iter != js_scripts.end();
++iter) {
- scripts_run_info->executing_scripts[extension_id_].insert(
+ scripts_run_info->executing_scripts[host_id_.id()].insert(
iter->url().path());
}
}
« no previous file with comments | « extensions/renderer/user_script_injector.h ('k') | extensions/renderer/user_script_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698