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

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: Fix use of scoped and linked ptrs, better documentation 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..de9822f87a9e2b8d966d91416475768ca28cd07b 100644
--- a/extensions/renderer/user_script_set.h
+++ b/extensions/renderer/user_script_set.h
@@ -31,8 +31,12 @@ 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:
+ // Provide UserScriptSetManager with accesss to OnUpdateUserScripts and
Jeffrey Yasskin 2014/07/28 17:47:16 s/accesss/access/
Mark Dittmer 2014/07/28 22:21:28 Done.
+ // scripts_.
+ friend class UserScriptSetManager;
Devlin 2014/07/28 18:15:27 nit: We usually put friend classes in the private:
Mark Dittmer 2014/07/28 22:21:28 Done, but this required an accessor for scripts_ a
+
class Observer {
Devlin 2014/07/28 18:15:27 Is this class still needed for anything?
Mark Dittmer 2014/07/28 22:21:28 Yes. The UserScriptInjector still observes each Us
public:
virtual void OnUserScriptsUpdated(
@@ -40,7 +44,7 @@ class UserScriptSet : public content::RenderProcessObserver {
const std::vector<UserScript*>& scripts) = 0;
};
- UserScriptSet(const ExtensionSet* extensions);
+ explicit UserScriptSet(const ExtensionSet* extensions);
virtual ~UserScriptSet();
// Adds or removes observers.
@@ -60,11 +64,10 @@ class UserScriptSet : public content::RenderProcessObserver {
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,
+ // Handle the UpdateUserScripts extension message. Return true if the
+ // method follows through on notifying observers of the change, or false if
+ // an error occurred.
+ bool OnUpdateUserScripts(base::SharedMemoryHandle shared_memory,
const std::set<std::string>& changed_extensions);
// Update the parsed scripts from |shared memory|.

Powered by Google App Engine
This is Rietveld 408576698