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_BROWSER_UTILITY_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "content/public/browser/browser_child_process_host_delegate.h" | 16 #include "content/public/browser/browser_child_process_host_delegate.h" |
(...skipping 10 matching lines...) Expand all Loading... |
27 virtual ~UtilityProcessHostImpl(); | 27 virtual ~UtilityProcessHostImpl(); |
28 | 28 |
29 // UtilityProcessHost implementation: | 29 // UtilityProcessHost implementation: |
30 virtual bool Send(IPC::Message* message) OVERRIDE; | 30 virtual bool Send(IPC::Message* message) OVERRIDE; |
31 virtual bool StartBatchMode() OVERRIDE; | 31 virtual bool StartBatchMode() OVERRIDE; |
32 virtual void EndBatchMode() OVERRIDE; | 32 virtual void EndBatchMode() OVERRIDE; |
33 virtual void SetExposedDir(const FilePath& dir) OVERRIDE; | 33 virtual void SetExposedDir(const FilePath& dir) OVERRIDE; |
34 virtual void DisableSandbox() OVERRIDE; | 34 virtual void DisableSandbox() OVERRIDE; |
35 virtual void EnableZygote() OVERRIDE; | 35 virtual void EnableZygote() OVERRIDE; |
36 #if defined(OS_POSIX) | 36 #if defined(OS_POSIX) |
37 virtual void SetEnv(const base::environment_vector& env) OVERRIDE; | 37 virtual void SetEnv(const base::EnvironmentVector& env) OVERRIDE; |
38 #endif | 38 #endif |
39 | 39 |
40 void set_child_flags(int flags) { child_flags_ = flags; } | 40 void set_child_flags(int flags) { child_flags_ = flags; } |
41 | 41 |
42 private: | 42 private: |
43 // Starts a process if necessary. Returns true if it succeeded or a process | 43 // Starts a process if necessary. Returns true if it succeeded or a process |
44 // has already been started via StartBatchMode(). | 44 // has already been started via StartBatchMode(). |
45 bool StartProcess(); | 45 bool StartProcess(); |
46 | 46 |
47 // BrowserChildProcessHost: | 47 // BrowserChildProcessHost: |
(...skipping 11 matching lines...) Expand all Loading... |
59 | 59 |
60 // Whether to pass switches::kNoSandbox to the child. | 60 // Whether to pass switches::kNoSandbox to the child. |
61 bool no_sandbox_; | 61 bool no_sandbox_; |
62 | 62 |
63 // Flags defined in ChildProcessHost with which to start the process. | 63 // Flags defined in ChildProcessHost with which to start the process. |
64 int child_flags_; | 64 int child_flags_; |
65 | 65 |
66 // Launch the utility process from the zygote. Defaults to false. | 66 // Launch the utility process from the zygote. Defaults to false. |
67 bool use_linux_zygote_; | 67 bool use_linux_zygote_; |
68 | 68 |
69 base::environment_vector env_; | 69 base::EnvironmentVector env_; |
70 | 70 |
71 bool started_; | 71 bool started_; |
72 | 72 |
73 scoped_ptr<BrowserChildProcessHostImpl> process_; | 73 scoped_ptr<BrowserChildProcessHostImpl> process_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); | 75 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); |
76 }; | 76 }; |
77 | 77 |
78 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_ | 78 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
OLD | NEW |