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

Unified Diff: extensions/renderer/user_script_set.h

Issue 404613006: Declarative content scripts: Renderer-side: per-extension shared memory regions (lazily loaded) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for last round of comments Created 6 years, 5 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/script_injection_manager.cc ('k') | extensions/renderer/user_script_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/user_script_set.h
diff --git a/extensions/renderer/user_script_set.h b/extensions/renderer/user_script_set.h
index 48fc641298eb4ca99cfc4d4af6269e0d6661c72f..e5e91fd418b2158bdfa0852cbcb43467b592da97 100644
--- a/extensions/renderer/user_script_set.h
+++ b/extensions/renderer/user_script_set.h
@@ -31,7 +31,7 @@ class ScriptInjection;
// The UserScriptSet is a collection of UserScripts which knows how to update
// itself from SharedMemory and create ScriptInjections for UserScripts to
// inject on a page.
-class UserScriptSet : public content::RenderProcessObserver {
+class UserScriptSet {
public:
class Observer {
public:
@@ -40,8 +40,8 @@ class UserScriptSet : public content::RenderProcessObserver {
const std::vector<UserScript*>& scripts) = 0;
};
- UserScriptSet(const ExtensionSet* extensions);
- virtual ~UserScriptSet();
+ explicit UserScriptSet(const ExtensionSet* extensions);
+ ~UserScriptSet();
// Adds or removes observers.
void AddObserver(Observer* observer);
@@ -59,17 +59,14 @@ class UserScriptSet : public content::RenderProcessObserver {
int tab_id,
UserScript::RunLocation run_location);
- private:
- // content::RenderProcessObserver implementation.
- virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
-
- // Handle the UpdateUserScripts extension message.
- void OnUpdateUserScripts(base::SharedMemoryHandle shared_memory,
- const std::set<std::string>& changed_extensions);
+ // Updates scripts given the shared memory region containing user scripts.
+ // Returns true if the scripts were successfully updated.
+ bool UpdateUserScripts(base::SharedMemoryHandle shared_memory,
+ const std::set<std::string>& changed_extensions);
- // Update the parsed scripts from |shared memory|.
- bool UpdateScripts(base::SharedMemoryHandle shared_memory);
+ const std::vector<UserScript*>& scripts() const { return scripts_.get(); }
+ private:
// Returns a new ScriptInjection for the given |script| to execute in the
// |web_frame|, or NULL if the script should not execute.
scoped_ptr<ScriptInjection> GetInjectionForScript(
« no previous file with comments | « extensions/renderer/script_injection_manager.cc ('k') | extensions/renderer/user_script_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698