OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 // process (in the same thread that called SignalReady). It can be NULL. | 73 // process (in the same thread that called SignalReady). It can be NULL. |
74 // |message_loop_proxy| must be of type IO and is the loop that POSIX uses | 74 // |message_loop_proxy| must be of type IO and is the loop that POSIX uses |
75 // to monitor the service process. | 75 // to monitor the service process. |
76 bool SignalReady( | 76 bool SignalReady( |
77 base::MessageLoopProxy* message_loop_proxy, Task* shutdown_task); | 77 base::MessageLoopProxy* message_loop_proxy, Task* shutdown_task); |
78 | 78 |
79 // Signal that the service process is stopped. | 79 // Signal that the service process is stopped. |
80 void SignalStopped(); | 80 void SignalStopped(); |
81 | 81 |
82 // Register the service process to run on startup. | 82 // Register the service process to run on startup. |
83 bool AddToAutoRun(CommandLine* command_line); | 83 bool AddToAutoRun(); |
84 | 84 |
85 // Unregister the service process to run on startup. | 85 // Unregister the service process to run on startup. |
86 bool RemoveFromAutoRun(); | 86 bool RemoveFromAutoRun(); |
87 | 87 |
88 // Return the channel handle used for communicating with the service. | 88 // Return the channel handle used for communicating with the service. |
89 IPC::ChannelHandle GetServiceProcessChannel(); | 89 IPC::ChannelHandle GetServiceProcessChannel(); |
90 | 90 |
91 private: | 91 private: |
92 ServiceProcessState(); | 92 ServiceProcessState(); |
93 ~ServiceProcessState(); | 93 ~ServiceProcessState(); |
(...skipping 10 matching lines...) Expand all Loading... | |
104 // means that a service process instance is already running. | 104 // means that a service process instance is already running. |
105 bool TakeSingletonLock(); | 105 bool TakeSingletonLock(); |
106 #endif // !OS_MACOSX | 106 #endif // !OS_MACOSX |
107 | 107 |
108 // Initialize the platform specific state. | 108 // Initialize the platform specific state. |
109 bool InitializeState(); | 109 bool InitializeState(); |
110 | 110 |
111 // Tear down the platform specific state. | 111 // Tear down the platform specific state. |
112 void TearDownState(); | 112 void TearDownState(); |
113 | 113 |
114 // Initializes the command-line that can be used to autorun the service | |
115 // process. | |
116 void CreateAutoRunCommandLine(); | |
Scott Byer
2011/02/25 18:19:24
nit: space before member vars
sanjeevr
2011/02/25 18:22:55
Done.
| |
114 // An opaque object that maintains state. The actual definition of this is | 117 // An opaque object that maintains state. The actual definition of this is |
115 // platform dependent. | 118 // platform dependent. |
116 struct StateData; | 119 struct StateData; |
117 StateData* state_; | 120 StateData* state_; |
118 scoped_ptr<base::SharedMemory> shared_mem_service_data_; | 121 scoped_ptr<base::SharedMemory> shared_mem_service_data_; |
122 scoped_ptr<CommandLine> autorun_command_line_; | |
119 | 123 |
120 friend struct DefaultSingletonTraits<ServiceProcessState>; | 124 friend struct DefaultSingletonTraits<ServiceProcessState>; |
121 }; | 125 }; |
122 | 126 |
123 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ | 127 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ |
OLD | NEW |