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

Unified Diff: chrome/renderer/user_script_slave.cc

Issue 6242010: Refactor away most of ExtensionRendererInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 11 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 | « chrome/renderer/user_script_slave.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/user_script_slave.cc
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index c047e05f29d0dc3a7f8b7f94cd0aa62a2a4087c0..3a1c5a5da2e207932a03fb6e80bfa36144a08e96 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -60,9 +60,10 @@ int UserScriptSlave::GetIsolatedWorldId(const std::string& extension_id) {
return new_id;
}
-UserScriptSlave::UserScriptSlave()
+UserScriptSlave::UserScriptSlave(const ExtensionRendererInfo* extensions)
: shared_memory_(NULL),
- script_deleter_(&scripts_) {
+ script_deleter_(&scripts_),
+ extensions_(extensions) {
api_js_ = ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_GREASEMONKEY_API_JS);
}
@@ -203,22 +204,15 @@ void UserScriptSlave::InjectScripts(WebFrame* frame,
if (frame->parent() && !script->match_all_frames())
continue; // Only match subframes if the script declared it wanted to.
- ExtensionRendererInfo* extension =
- ExtensionRendererInfo::GetByID(script->extension_id());
+ const Extension* extension = extensions_->GetByID(script->extension_id());
// Since extension info is sent separately from user script info, they can
// be out of sync. We just ignore this situation.
if (!extension)
continue;
- if (!Extension::CanExecuteScriptOnPage(
- frame_url,
- extension->allowed_to_execute_script_everywhere(),
- NULL,
- script,
- NULL)) {
+ if (!extension->CanExecuteScriptOnPage(frame_url, script, NULL))
continue;
- }
if (frame_url.SchemeIsFile() && !script->allow_file_access())
continue; // This script isn't allowed to run on file URLs.
« no previous file with comments | « chrome/renderer/user_script_slave.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698