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

Unified Diff: extensions/browser/process_manager.h

Issue 212603020: Break extensions ProcessManager dependency on Runtime API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (pm-observer) Created 6 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
« no previous file with comments | « chrome/browser/extensions/api/runtime/runtime_api.cc ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/process_manager.h
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h
index 0ce67521235c1d64689e7df53eb713e47eb1bcf4..664c9420fde504a05d071e6de9a9a232722b57fa 100644
--- a/extensions/browser/process_manager.h
+++ b/extensions/browser/process_manager.h
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "base/time/time.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -32,6 +33,7 @@ namespace extensions {
class Extension;
class ExtensionHost;
+class ProcessManagerObserver;
// Manages dynamic state of running Chromium extensions. There is one instance
// of this class per Profile. OTR Profiles have a separate instance that keeps
@@ -51,6 +53,10 @@ class ProcessManager : public content::NotificationObserver {
typedef std::set<content::RenderViewHost*> ViewSet;
const ViewSet GetAllViews() const;
+ // The typical observer interface.
+ void AddObserver(ProcessManagerObserver* observer);
+ void RemoveObserver(ProcessManagerObserver* observer);
+
// Creates a new UI-less extension instance. Like CreateViewHost, but not
// displayed anywhere. Returns false if no background host can be created,
// for example for hosted apps and extensions that aren't enabled in
@@ -238,6 +244,8 @@ class ProcessManager : public content::NotificationObserver {
ImpulseCallbackForTesting keepalive_impulse_callback_for_testing_;
ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_;
+ ObserverList<ProcessManagerObserver> observer_list_;
+
base::WeakPtrFactory<ProcessManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ProcessManager);
« no previous file with comments | « chrome/browser/extensions/api/runtime/runtime_api.cc ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698