OLD | NEW |
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 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" |
| 11 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/process.h" | 13 #include "base/process.h" |
13 #include "base/shared_memory.h" | 14 #include "base/shared_memory.h" |
14 #include "ipc/ipc_channel_handle.h" | 15 #include "ipc/ipc_channel_handle.h" |
15 | 16 |
16 class Task; | 17 class Task; |
17 class CommandLine; | 18 class CommandLine; |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class MessageLoopProxy; | 21 class MessageLoopProxy; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Returns false if another service process is already running. | 66 // Returns false if another service process is already running. |
66 bool Initialize(); | 67 bool Initialize(); |
67 | 68 |
68 // Signal that the service process is ready. | 69 // Signal that the service process is ready. |
69 // This method is called when the service process is running and initialized. | 70 // This method is called when the service process is running and initialized. |
70 // |terminate_task| is invoked when we get a terminate request from another | 71 // |terminate_task| is invoked when we get a terminate request from another |
71 // process (in the same thread that called SignalReady). It can be NULL. | 72 // process (in the same thread that called SignalReady). It can be NULL. |
72 // |message_loop_proxy| must be of type IO and is the loop that POSIX uses | 73 // |message_loop_proxy| must be of type IO and is the loop that POSIX uses |
73 // to monitor the service process. | 74 // to monitor the service process. |
74 bool SignalReady( | 75 bool SignalReady( |
75 base::MessageLoopProxy* message_loop_proxy, Task* terminate_task); | 76 base::MessageLoopProxy* message_loop_proxy, |
| 77 const base::Closure& terminate_task); |
76 | 78 |
77 // Signal that the service process is stopped. | 79 // Signal that the service process is stopped. |
78 void SignalStopped(); | 80 void SignalStopped(); |
79 | 81 |
80 // Register the service process to run on startup. | 82 // Register the service process to run on startup. |
81 bool AddToAutoRun(); | 83 bool AddToAutoRun(); |
82 | 84 |
83 // Unregister the service process to run on startup. | 85 // Unregister the service process to run on startup. |
84 bool RemoveFromAutoRun(); | 86 bool RemoveFromAutoRun(); |
85 | 87 |
(...skipping 27 matching lines...) Expand all Loading... |
113 | 115 |
114 // An opaque object that maintains state. The actual definition of this is | 116 // An opaque object that maintains state. The actual definition of this is |
115 // platform dependent. | 117 // platform dependent. |
116 struct StateData; | 118 struct StateData; |
117 StateData* state_; | 119 StateData* state_; |
118 scoped_ptr<base::SharedMemory> shared_mem_service_data_; | 120 scoped_ptr<base::SharedMemory> shared_mem_service_data_; |
119 scoped_ptr<CommandLine> autorun_command_line_; | 121 scoped_ptr<CommandLine> autorun_command_line_; |
120 }; | 122 }; |
121 | 123 |
122 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ | 124 #endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_ |
OLD | NEW |