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

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

Issue 9368017: mac: Add _EXPORT macros, content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « content/browser/find_pasteboard.h ('k') | content/browser/tab_contents/web_contents_view_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CONTENT_BROWSER_MACH_BROKER_MAC_H_ 5 #ifndef CONTENT_BROWSER_MACH_BROKER_MAC_H_
6 #define CONTENT_BROWSER_MACH_BROKER_MAC_H_ 6 #define CONTENT_BROWSER_MACH_BROKER_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 18 matching lines...) Expand all
29 // the regular IPC system uses. Hence, the child processes open a Mach 29 // the regular IPC system uses. Hence, the child processes open a Mach
30 // connection shortly after launching and ipc their mach data to the browser 30 // connection shortly after launching and ipc their mach data to the browser
31 // process. This data is kept in a global |MachBroker| object. 31 // process. This data is kept in a global |MachBroker| object.
32 // 32 //
33 // Since this data arrives over a separate channel, it is not available 33 // Since this data arrives over a separate channel, it is not available
34 // immediately after a child process has been started. 34 // immediately after a child process has been started.
35 class MachBroker : public base::ProcessMetrics::PortProvider, 35 class MachBroker : public base::ProcessMetrics::PortProvider,
36 public content::NotificationObserver { 36 public content::NotificationObserver {
37 public: 37 public:
38 // Returns the global MachBroker. 38 // Returns the global MachBroker.
39 static MachBroker* GetInstance(); 39 CONTENT_EXPORT static MachBroker* GetInstance();
40 40
41 // Performs any necessary setup that cannot happen in the constructor. 41 // Performs any necessary setup that cannot happen in the constructor.
42 // Callers MUST acquire the lock given by GetLock() before calling this 42 // Callers MUST acquire the lock given by GetLock() before calling this
43 // method (and release the lock afterwards). 43 // method (and release the lock afterwards).
44 void EnsureRunning(); 44 void EnsureRunning();
45 45
46 struct MachInfo { 46 struct MachInfo {
47 MachInfo() : mach_task_(MACH_PORT_NULL) {} 47 MachInfo() : mach_task_(MACH_PORT_NULL) {}
48 48
49 MachInfo& SetTask(mach_port_t task) { 49 MachInfo& SetTask(mach_port_t task) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 typedef std::map<base::ProcessHandle, MachInfo> MachMap; 106 typedef std::map<base::ProcessHandle, MachInfo> MachMap;
107 MachMap mach_map_; 107 MachMap mach_map_;
108 108
109 // Mutex that guards |mach_map_|. 109 // Mutex that guards |mach_map_|.
110 mutable base::Lock lock_; 110 mutable base::Lock lock_;
111 111
112 DISALLOW_COPY_AND_ASSIGN(MachBroker); 112 DISALLOW_COPY_AND_ASSIGN(MachBroker);
113 }; 113 };
114 114
115 #endif // CONTENT_BROWSER_MACH_BROKER_MAC_H_ 115 #endif // CONTENT_BROWSER_MACH_BROKER_MAC_H_
OLDNEW
« no previous file with comments | « content/browser/find_pasteboard.h ('k') | content/browser/tab_contents/web_contents_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698