| 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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 16 #include "content/public/browser/browser_child_process_host_delegate.h" | 17 #include "content/public/browser/browser_child_process_host_delegate.h" |
| 17 #include "content/public/browser/utility_process_host.h" | 18 #include "content/public/browser/utility_process_host.h" |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class SequencedTaskRunner; | 21 class SequencedTaskRunner; |
| 21 } | 22 } |
| 22 | 23 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 // UtilityProcessHost implementation: | 36 // UtilityProcessHost implementation: |
| 36 virtual bool Send(IPC::Message* message) OVERRIDE; | 37 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 37 virtual bool StartBatchMode() OVERRIDE; | 38 virtual bool StartBatchMode() OVERRIDE; |
| 38 virtual void EndBatchMode() OVERRIDE; | 39 virtual void EndBatchMode() OVERRIDE; |
| 39 virtual void SetExposedDir(const base::FilePath& dir) OVERRIDE; | 40 virtual void SetExposedDir(const base::FilePath& dir) OVERRIDE; |
| 40 virtual void EnableMDns() OVERRIDE; | 41 virtual void EnableMDns() OVERRIDE; |
| 41 virtual void DisableSandbox() OVERRIDE; | 42 virtual void DisableSandbox() OVERRIDE; |
| 42 virtual void EnableZygote() OVERRIDE; | 43 virtual void EnableZygote() OVERRIDE; |
| 43 virtual const ChildProcessData& GetData() OVERRIDE; | 44 virtual const ChildProcessData& GetData() OVERRIDE; |
| 44 #if defined(OS_POSIX) | 45 #if defined(OS_POSIX) |
| 45 virtual void SetEnv(const base::EnvironmentVector& env) OVERRIDE; | 46 virtual void SetEnv(const base::EnvironmentMap& env) OVERRIDE; |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 void set_child_flags(int flags) { child_flags_ = flags; } | 49 void set_child_flags(int flags) { child_flags_ = flags; } |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 // Starts a process if necessary. Returns true if it succeeded or a process | 52 // Starts a process if necessary. Returns true if it succeeded or a process |
| 52 // has already been started via StartBatchMode(). | 53 // has already been started via StartBatchMode(). |
| 53 bool StartProcess(); | 54 bool StartProcess(); |
| 54 | 55 |
| 55 // BrowserChildProcessHost: | 56 // BrowserChildProcessHost: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 70 | 71 |
| 71 // Whether to pass switches::kNoSandbox to the child. | 72 // Whether to pass switches::kNoSandbox to the child. |
| 72 bool no_sandbox_; | 73 bool no_sandbox_; |
| 73 | 74 |
| 74 // Flags defined in ChildProcessHost with which to start the process. | 75 // Flags defined in ChildProcessHost with which to start the process. |
| 75 int child_flags_; | 76 int child_flags_; |
| 76 | 77 |
| 77 // Launch the utility process from the zygote. Defaults to false. | 78 // Launch the utility process from the zygote. Defaults to false. |
| 78 bool use_linux_zygote_; | 79 bool use_linux_zygote_; |
| 79 | 80 |
| 80 base::EnvironmentVector env_; | 81 base::EnvironmentMap env_; |
| 81 | 82 |
| 82 bool started_; | 83 bool started_; |
| 83 | 84 |
| 84 scoped_ptr<BrowserChildProcessHostImpl> process_; | 85 scoped_ptr<BrowserChildProcessHostImpl> process_; |
| 85 | 86 |
| 86 #if !defined(CHROME_MULTIPLE_DLL) | 87 #if !defined(CHROME_MULTIPLE_DLL) |
| 87 // Used in single-process mode instead of process_. | 88 // Used in single-process mode instead of process_. |
| 88 scoped_ptr<UtilityMainThread> in_process_thread_; | 89 scoped_ptr<UtilityMainThread> in_process_thread_; |
| 89 #endif | 90 #endif |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); | 92 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespace content | 95 } // namespace content |
| 95 | 96 |
| 96 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ | 97 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |