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 CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ |
6 #define CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ |
7 | 7 |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "ipc/ipc_sender.h" | 10 #include "ipc/ipc_sender.h" |
11 | 11 |
| 12 namespace base { |
12 class FilePath; | 13 class FilePath; |
13 | |
14 namespace base { | |
15 class SequencedTaskRunner; | 14 class SequencedTaskRunner; |
16 } | 15 } |
17 | 16 |
18 namespace content { | 17 namespace content { |
19 class UtilityProcessHostClient; | 18 class UtilityProcessHostClient; |
20 struct ChildProcessData; | 19 struct ChildProcessData; |
21 | 20 |
22 // This class acts as the browser-side host to a utility child process. A | 21 // This class acts as the browser-side host to a utility child process. A |
23 // utility process is a short-lived process that is created to run a specific | 22 // utility process is a short-lived process that is created to run a specific |
24 // task. This class lives solely on the IO thread. | 23 // task. This class lives solely on the IO thread. |
(...skipping 17 matching lines...) Expand all Loading... |
42 | 41 |
43 // Starts utility process in batch mode. Caller must call EndBatchMode() | 42 // Starts utility process in batch mode. Caller must call EndBatchMode() |
44 // to finish the utility process. | 43 // to finish the utility process. |
45 virtual bool StartBatchMode() = 0; | 44 virtual bool StartBatchMode() = 0; |
46 | 45 |
47 // Ends the utility process. Must be called after StartBatchMode(). | 46 // Ends the utility process. Must be called after StartBatchMode(). |
48 virtual void EndBatchMode() = 0; | 47 virtual void EndBatchMode() = 0; |
49 | 48 |
50 // Allows a directory to be opened through the sandbox, in case it's needed by | 49 // Allows a directory to be opened through the sandbox, in case it's needed by |
51 // the operation. | 50 // the operation. |
52 virtual void SetExposedDir(const FilePath& dir) = 0; | 51 virtual void SetExposedDir(const base::FilePath& dir) = 0; |
53 | 52 |
54 // Make the process run without a sandbox. | 53 // Make the process run without a sandbox. |
55 virtual void DisableSandbox() = 0; | 54 virtual void DisableSandbox() = 0; |
56 | 55 |
57 // If the sandbox is being used and we are on Linux, launch the process from | 56 // If the sandbox is being used and we are on Linux, launch the process from |
58 // the zygote. Can only be used for tasks that do not require FS access. | 57 // the zygote. Can only be used for tasks that do not require FS access. |
59 virtual void EnableZygote() = 0; | 58 virtual void EnableZygote() = 0; |
60 | 59 |
61 // Returns information about the utility child process. | 60 // Returns information about the utility child process. |
62 virtual const ChildProcessData& GetData() = 0; | 61 virtual const ChildProcessData& GetData() = 0; |
63 | 62 |
64 #if defined(OS_POSIX) | 63 #if defined(OS_POSIX) |
65 virtual void SetEnv(const base::EnvironmentVector& env) = 0; | 64 virtual void SetEnv(const base::EnvironmentVector& env) = 0; |
66 #endif | 65 #endif |
67 }; | 66 }; |
68 | 67 |
69 }; // namespace content | 68 }; // namespace content |
70 | 69 |
71 #endif // CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ | 70 #endif // CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_H_ |
OLD | NEW |