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

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: Implement third 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
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(

Powered by Google App Engine
This is Rietveld 408576698