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

Unified Diff: chrome/browser/mach_broker_mac.h

Issue 460126: Mac: Proof-of-concept task manager (Closed)
Patch Set: rebase Created 10 years, 12 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: chrome/browser/mach_broker_mac.h
diff --git a/chrome/browser/mach_broker_mac.h b/chrome/browser/mach_broker_mac.h
index 67f4fec48712c9529d84980eb2ad48f45a73e37b..457cd98c55f494080a0594645530a4d0e8a88e6d 100644
--- a/chrome/browser/mach_broker_mac.h
+++ b/chrome/browser/mach_broker_mac.h
@@ -13,6 +13,7 @@
#include "base/process.h"
#include "base/process_util.h"
#include "base/singleton.h"
+#include "chrome/common/notification_registrar.h"
// On OS X, the mach_port_t of a process is required to collect metrics about
// the process. Running |task_for_pid()| is only allowed for privileged code.
@@ -28,7 +29,8 @@
//
// Since this data arrives over a separate channel, it is not available
// immediately after a child process has been started.
-class MachBroker : public base::ProcessMetrics::PortProvider {
+class MachBroker : public base::ProcessMetrics::PortProvider,
+ public NotificationObserver {
public:
// Returns the global MachBroker.
static MachBroker* instance();
@@ -53,9 +55,17 @@ class MachBroker : public base::ProcessMetrics::PortProvider {
// Implement |ProcessMetrics::PortProvider|.
virtual mach_port_t TaskForPid(base::ProcessHandle process) const;
+ // Implement |NotificationObserver|.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
private:
// Private constructor.
- MachBroker() {}
+ MachBroker();
+
+ // Used to register for notifications received by NotificationObserver.
+ NotificationRegistrar registrar_;
+
friend struct DefaultSingletonTraits<MachBroker>;
friend class MachBrokerTest;

Powered by Google App Engine
This is Rietveld 408576698