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

Unified Diff: extensions/renderer/user_script_set_manager.h

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
Index: extensions/renderer/user_script_set_manager.h
diff --git a/extensions/renderer/user_script_set_manager.h b/extensions/renderer/user_script_set_manager.h
index 4b5e4f053d72d9c3139e82610e900f1532ca8991..49e547a3d61f6583873597a17876b0288c18fae5 100644
--- a/extensions/renderer/user_script_set_manager.h
+++ b/extensions/renderer/user_script_set_manager.h
@@ -34,8 +34,8 @@ class ScriptInjection;
// Regions are organized as follows:
// static_scripts -- contains all extensions' scripts that are statically
// declared in the extension manifest.
-// programmatic_scripts -- one region per extension containing only
-// programmatically-declared scripts, instantiated
+// programmatic_scripts -- one region per host (extension or WebUI) containing
+// only programmatically-declared scripts, instantiated
// when an extension first creates a declarative rule
// that would, if triggered, request a script injection.
class UserScriptSetManager : public content::RenderProcessObserver {
@@ -45,7 +45,7 @@ class UserScriptSetManager : public content::RenderProcessObserver {
class Observer {
public:
virtual void OnUserScriptsUpdated(
- const std::set<std::string>& changed_extensions,
+ const std::set<HostID>& changed_hosts,
const std::vector<UserScript*>& scripts) = 0;
};
@@ -81,18 +81,17 @@ class UserScriptSetManager : public content::RenderProcessObserver {
private:
// Map for per-extension sets that may be defined programmatically.
- typedef std::map<ExtensionId, linked_ptr<UserScriptSet> > UserScriptSetMap;
+ typedef std::map<HostID, linked_ptr<UserScriptSet> > UserScriptSetMap;
// content::RenderProcessObserver implementation.
bool OnControlMessageReceived(const IPC::Message& message) override;
- UserScriptSet* GetProgrammaticScriptsByExtension(
- const ExtensionId& extensionId);
+ UserScriptSet* GetProgrammaticScriptsByHostID(const HostID& host_id);
// Handle the UpdateUserScripts extension message.
void OnUpdateUserScripts(base::SharedMemoryHandle shared_memory,
- const ExtensionId& extension_id,
- const std::set<std::string>& changed_extensions);
+ const HostID& host_id,
+ const std::set<HostID>& changed_hosts);
// Scripts statically defined in extension manifests.
UserScriptSet static_scripts_;

Powered by Google App Engine
This is Rietveld 408576698