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_BROWSER_SERVICE_PROCESS_SERVICE_PROCESS_CONTROL_H_ | 5 #ifndef CHROME_BROWSER_SERVICE_PROCESS_SERVICE_PROCESS_CONTROL_H_ |
6 #define CHROME_BROWSER_SERVICE_PROCESS_SERVICE_PROCESS_CONTROL_H_ | 6 #define CHROME_BROWSER_SERVICE_PROCESS_SERVICE_PROCESS_CONTROL_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // reply from service. The method resets any previous callback. | 138 // reply from service. The method resets any previous callback. |
139 // This call starts service if needed. | 139 // This call starts service if needed. |
140 bool GetPrinters(const PrintersCallback& enumerate_printers_callback); | 140 bool GetPrinters(const PrintersCallback& enumerate_printers_callback); |
141 | 141 |
142 private: | 142 private: |
143 // This class is responsible for launching the service process on the | 143 // This class is responsible for launching the service process on the |
144 // PROCESS_LAUNCHER thread. | 144 // PROCESS_LAUNCHER thread. |
145 class Launcher | 145 class Launcher |
146 : public base::RefCountedThreadSafe<ServiceProcessControl::Launcher> { | 146 : public base::RefCountedThreadSafe<ServiceProcessControl::Launcher> { |
147 public: | 147 public: |
148 Launcher(ServiceProcessControl* process, base::CommandLine* cmd_line); | 148 Launcher(ServiceProcessControl* process, |
| 149 scoped_ptr<base::CommandLine> cmd_line); |
149 // Execute the command line to start the process asynchronously. After the | 150 // Execute the command line to start the process asynchronously. After the |
150 // command is executed |task| is called with the process handle on the UI | 151 // command is executed |task| is called with the process handle on the UI |
151 // thread. | 152 // thread. |
152 void Run(const base::Closure& task); | 153 void Run(const base::Closure& task); |
153 | 154 |
154 bool launched() const { return launched_; } | 155 bool launched() const { return launched_; } |
155 | 156 |
156 private: | 157 private: |
157 friend class base::RefCountedThreadSafe<ServiceProcessControl::Launcher>; | 158 friend class base::RefCountedThreadSafe<ServiceProcessControl::Launcher>; |
158 virtual ~Launcher(); | 159 virtual ~Launcher(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // the service process. | 229 // the service process. |
229 base::Closure histograms_callback_; | 230 base::Closure histograms_callback_; |
230 | 231 |
231 content::NotificationRegistrar registrar_; | 232 content::NotificationRegistrar registrar_; |
232 | 233 |
233 // Callback that gets invoked if service didn't reply in time. | 234 // Callback that gets invoked if service didn't reply in time. |
234 base::CancelableClosure histograms_timeout_callback_; | 235 base::CancelableClosure histograms_timeout_callback_; |
235 }; | 236 }; |
236 | 237 |
237 #endif // CHROME_BROWSER_SERVICE_PROCESS_SERVICE_PROCESS_CONTROL_H_ | 238 #endif // CHROME_BROWSER_SERVICE_PROCESS_SERVICE_PROCESS_CONTROL_H_ |
OLD | NEW |