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 CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ | 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ | 6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "content/common/content_export.h" |
12 | 13 |
13 class CommandLine; | 14 class CommandLine; |
14 | 15 |
15 // Launches a process asynchronously and notifies the client of the process | 16 // Launches a process asynchronously and notifies the client of the process |
16 // handle when it's available. It's used to avoid blocking the calling thread | 17 // handle when it's available. It's used to avoid blocking the calling thread |
17 // on the OS since often it can take > 100 ms to create the process. | 18 // on the OS since often it can take > 100 ms to create the process. |
18 class ChildProcessLauncher { | 19 class CONTENT_EXPORT ChildProcessLauncher { |
19 public: | 20 public: |
20 class Client { | 21 class CONTENT_EXPORT Client { |
21 public: | 22 public: |
22 // Will be called on the thread that the ChildProcessLauncher was | 23 // Will be called on the thread that the ChildProcessLauncher was |
23 // constructed on. | 24 // constructed on. |
24 virtual void OnProcessLaunched() = 0; | 25 virtual void OnProcessLaunched() = 0; |
25 | 26 |
26 protected: | 27 protected: |
27 virtual ~Client() {} | 28 virtual ~Client() {} |
28 }; | 29 }; |
29 | 30 |
30 // Launches the process asynchronously, calling the client when the result is | 31 // Launches the process asynchronously, calling the client when the result is |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 67 |
67 private: | 68 private: |
68 class Context; | 69 class Context; |
69 | 70 |
70 scoped_refptr<Context> context_; | 71 scoped_refptr<Context> context_; |
71 | 72 |
72 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); | 73 DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); |
73 }; | 74 }; |
74 | 75 |
75 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ | 76 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_H_ |
OLD | NEW |