OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_SERVICE_PROCESS_UTIL_H_ | 5 #ifndef CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ |
6 #define CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ | 6 #define CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 #endif | 25 #endif |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class CommandLine; | 28 class CommandLine; |
29 class MessageLoopProxy; | 29 class MessageLoopProxy; |
30 } | 30 } |
31 | 31 |
32 // Return the IPC channel to connect to the service process. | 32 // Return the IPC channel to connect to the service process. |
33 IPC::ChannelHandle GetServiceProcessChannel(); | 33 IPC::ChannelHandle GetServiceProcessChannel(); |
34 | 34 |
35 #if !defined(OS_MACOSX) | |
36 // Return a name that is scoped to this instance of the service process. We | 35 // Return a name that is scoped to this instance of the service process. We |
37 // use the user-data-dir as a scoping prefix. | 36 // use the user-data-dir as a scoping prefix. |
38 std::string GetServiceProcessScopedName(const std::string& append_str); | 37 std::string GetServiceProcessScopedName(const std::string& append_str); |
39 | 38 |
39 #if !defined(OS_MACOSX) | |
40 // Return a name that is scoped to this instance of the service process. We | 40 // Return a name that is scoped to this instance of the service process. We |
41 // use the user-data-dir and the version as a scoping prefix. | 41 // use the user-data-dir and the version as a scoping prefix. |
42 std::string GetServiceProcessScopedVersionedName(const std::string& append_str); | 42 std::string GetServiceProcessScopedVersionedName(const std::string& append_str); |
43 #endif // OS_MACOSX | 43 #endif // OS_MACOSX |
Lei Zhang
2015/03/12 19:23:48
This should be !defined(OS_MACOSX)
Vitaly Buka (NO REVIEWS)
2015/03/12 19:44:13
Done.
| |
44 | 44 |
45 #if defined(OS_MACOSX) | |
46 // Return the name that is used to extract the socket path out of the | |
47 // dictionary provided by launchd. | |
48 NSString* GetServiceProcessLaunchDSocketEnvVar(); | |
49 #endif | |
50 | |
51 #if defined(OS_POSIX) | 45 #if defined(OS_POSIX) |
52 // Attempts to take a lock named |name|. If |waiting| is true then this will | 46 // Attempts to take a lock named |name|. If |waiting| is true then this will |
53 // make multiple attempts to acquire the lock. | 47 // make multiple attempts to acquire the lock. |
54 // Caller is responsible for ownership of the MultiProcessLock. | 48 // Caller is responsible for ownership of the MultiProcessLock. |
55 MultiProcessLock* TakeNamedLock(const std::string& name, bool waiting); | 49 MultiProcessLock* TakeNamedLock(const std::string& name, bool waiting); |
56 #endif | 50 #endif |
57 | 51 |
58 // The following methods are used in a process that acts as a client to the | 52 // The following methods are used in a process that acts as a client to the |
59 // service process (typically the browser process). | 53 // service process (typically the browser process). |
60 // -------------------------------------------------------------------------- | 54 // -------------------------------------------------------------------------- |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 | 128 |
135 // An opaque object that maintains state. The actual definition of this is | 129 // An opaque object that maintains state. The actual definition of this is |
136 // platform dependent. | 130 // platform dependent. |
137 struct StateData; | 131 struct StateData; |
138 StateData* state_; | 132 StateData* state_; |
139 scoped_ptr<base::SharedMemory> shared_mem_service_data_; | 133 scoped_ptr<base::SharedMemory> shared_mem_service_data_; |
140 scoped_ptr<base::CommandLine> autorun_command_line_; | 134 scoped_ptr<base::CommandLine> autorun_command_line_; |
141 }; | 135 }; |
142 | 136 |
143 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ | 137 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ |
OLD | NEW |