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

Side by Side Diff: chrome/browser/mach_broker_mac.h

Issue 6542027: Out of line cleanups for Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Killer rebase. :( Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MACH_BROKER_H_ 5 #ifndef CHROME_BROWSER_MACH_BROKER_H_
6 #define CHROME_BROWSER_MACH_BROKER_H_ 6 #define CHROME_BROWSER_MACH_BROKER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Implement |ProcessMetrics::PortProvider|. 79 // Implement |ProcessMetrics::PortProvider|.
80 virtual mach_port_t TaskForPid(base::ProcessHandle process) const; 80 virtual mach_port_t TaskForPid(base::ProcessHandle process) const;
81 81
82 // Implement |NotificationObserver|. 82 // Implement |NotificationObserver|.
83 virtual void Observe(NotificationType type, 83 virtual void Observe(NotificationType type,
84 const NotificationSource& source, 84 const NotificationSource& source,
85 const NotificationDetails& details); 85 const NotificationDetails& details);
86 private: 86 private:
87 // Private constructor. 87 // Private constructor.
88 MachBroker(); 88 MachBroker();
89 ~MachBroker();
89 90
90 // True if the listener thread has been started. 91 // True if the listener thread has been started.
91 bool listener_thread_started_; 92 bool listener_thread_started_;
92 93
93 // Used to register for notifications received by NotificationObserver. 94 // Used to register for notifications received by NotificationObserver.
94 // Accessed only on the UI thread. 95 // Accessed only on the UI thread.
95 NotificationRegistrar registrar_; 96 NotificationRegistrar registrar_;
96 97
97 // Stores mach info for every process in the broker. 98 // Stores mach info for every process in the broker.
98 typedef std::map<base::ProcessHandle, MachInfo> MachMap; 99 typedef std::map<base::ProcessHandle, MachInfo> MachMap;
99 MachMap mach_map_; 100 MachMap mach_map_;
100 101
101 // Mutex that guards |mach_map_|. 102 // Mutex that guards |mach_map_|.
102 mutable base::Lock lock_; 103 mutable base::Lock lock_;
103 104
104 friend class MachBrokerTest; 105 friend class MachBrokerTest;
105 friend class RegisterNotificationTask; 106 friend class RegisterNotificationTask;
106 // Needed in order to make the constructor private. 107 // Needed in order to make the constructor private.
107 friend struct DefaultSingletonTraits<MachBroker>; 108 friend struct DefaultSingletonTraits<MachBroker>;
108 DISALLOW_COPY_AND_ASSIGN(MachBroker); 109 DISALLOW_COPY_AND_ASSIGN(MachBroker);
109 }; 110 };
110 111
111 #endif // CHROME_BROWSER_MACH_BROKER_H_ 112 #endif // CHROME_BROWSER_MACH_BROKER_H_
112 113
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_mac.mm ('k') | chrome/browser/mach_broker_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698