Chromium Code Reviews| 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..597b07766e347b5dc8e1e683b3c485bfad79c70f 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,7 +40,7 @@ class UserScriptSet : public content::RenderProcessObserver { |
| const std::vector<UserScript*>& scripts) = 0; |
| }; |
| - UserScriptSet(const ExtensionSet* extensions); |
| + explicit UserScriptSet(const ExtensionSet* extensions); |
| virtual ~UserScriptSet(); |
|
Devlin
2014/07/29 22:06:39
nit: no longer need virtual destructor
Mark Dittmer
2014/07/29 22:20:41
Done.
|
| // Adds or removes observers. |
| @@ -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, |
| + // Updates scripts given the shared memory region containing user scripts. |
| + // Returns true if the scripts were successfully updated. |
| + bool OnUpdateUserScripts(base::SharedMemoryHandle shared_memory, |
|
Devlin
2014/07/29 22:06:39
nit: just call this UpdateUserScripts.
Mark Dittmer
2014/07/29 22:20:41
Done.
|
| 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( |