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 |
(...skipping 22 matching lines...) Expand all Loading... | |
33 base::SequencedTaskRunner* client_task_runner); | 33 base::SequencedTaskRunner* client_task_runner); |
34 virtual ~UtilityProcessHostImpl(); | 34 virtual ~UtilityProcessHostImpl(); |
35 | 35 |
36 // UtilityProcessHost implementation: | 36 // UtilityProcessHost implementation: |
37 virtual bool Send(IPC::Message* message) OVERRIDE; | 37 virtual bool Send(IPC::Message* message) OVERRIDE; |
38 virtual bool StartBatchMode() OVERRIDE; | 38 virtual bool StartBatchMode() OVERRIDE; |
39 virtual void EndBatchMode() OVERRIDE; | 39 virtual void EndBatchMode() OVERRIDE; |
40 virtual void SetExposedDir(const base::FilePath& dir) OVERRIDE; | 40 virtual void SetExposedDir(const base::FilePath& dir) OVERRIDE; |
41 virtual void EnableMDns() OVERRIDE; | 41 virtual void EnableMDns() OVERRIDE; |
42 virtual void DisableSandbox() OVERRIDE; | 42 virtual void DisableSandbox() OVERRIDE; |
43 #if defined(OS_WIN) | |
44 virtual void ElevatePrivileges() OVERRIDE; | |
45 #endif | |
43 virtual void EnableZygote() OVERRIDE; | 46 virtual void EnableZygote() OVERRIDE; |
44 virtual const ChildProcessData& GetData() OVERRIDE; | 47 virtual const ChildProcessData& GetData() OVERRIDE; |
45 #if defined(OS_POSIX) | 48 #if defined(OS_POSIX) |
46 virtual void SetEnv(const base::EnvironmentMap& env) OVERRIDE; | 49 virtual void SetEnv(const base::EnvironmentMap& env) OVERRIDE; |
47 #endif | 50 #endif |
48 | 51 |
49 void set_child_flags(int flags) { child_flags_ = flags; } | 52 void set_child_flags(int flags) { child_flags_ = flags; } |
50 | 53 |
51 private: | 54 private: |
52 // Starts a process if necessary. Returns true if it succeeded or a process | 55 // Starts a process if necessary. Returns true if it succeeded or a process |
53 // has already been started via StartBatchMode(). | 56 // has already been started via StartBatchMode(). |
54 bool StartProcess(); | 57 bool StartProcess(); |
55 | 58 |
56 // BrowserChildProcessHost: | 59 // BrowserChildProcessHost: |
57 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 60 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
61 virtual void OnProcessLaunchFailed() OVERRIDE; | |
58 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | 62 virtual void OnProcessCrashed(int exit_code) OVERRIDE; |
59 | 63 |
60 // A pointer to our client interface, who will be informed of progress. | 64 // A pointer to our client interface, who will be informed of progress. |
61 scoped_refptr<UtilityProcessHostClient> client_; | 65 scoped_refptr<UtilityProcessHostClient> client_; |
62 scoped_refptr<base::SequencedTaskRunner> client_task_runner_; | 66 scoped_refptr<base::SequencedTaskRunner> client_task_runner_; |
63 // True when running in batch mode, i.e., StartBatchMode() has been called | 67 // True when running in batch mode, i.e., StartBatchMode() has been called |
64 // and the utility process will run until EndBatchMode(). | 68 // and the utility process will run until EndBatchMode(). |
65 bool is_batch_mode_; | 69 bool is_batch_mode_; |
66 | 70 |
67 base::FilePath exposed_dir_; | 71 base::FilePath exposed_dir_; |
68 | 72 |
69 // Whether utility process needs perform presandbox initialization for MDns. | 73 // Whether utility process needs perform presandbox initialization for MDns. |
70 bool is_mdns_enabled_; | 74 bool is_mdns_enabled_; |
71 | 75 |
72 // Whether to pass switches::kNoSandbox to the child. | 76 // Whether to pass switches::kNoSandbox to the child. |
73 bool no_sandbox_; | 77 bool no_sandbox_; |
74 | 78 |
79 #if defined(OS_WIN) | |
80 // Whether to launch the process with elevated permissions. | |
Jorge Lucangeli Obes
2014/02/03 22:14:59
Nit: either change this to "privileges" or the abo
Drew Haven
2014/02/04 21:25:54
Ah yes. I'm trying to be consisted with "elevated
| |
81 bool run_elevated_; | |
82 #endif | |
83 | |
75 // Flags defined in ChildProcessHost with which to start the process. | 84 // Flags defined in ChildProcessHost with which to start the process. |
76 int child_flags_; | 85 int child_flags_; |
77 | 86 |
78 // Launch the utility process from the zygote. Defaults to false. | 87 // Launch the utility process from the zygote. Defaults to false. |
79 bool use_linux_zygote_; | 88 bool use_linux_zygote_; |
80 | 89 |
81 base::EnvironmentMap env_; | 90 base::EnvironmentMap env_; |
82 | 91 |
83 bool started_; | 92 bool started_; |
84 | 93 |
85 scoped_ptr<BrowserChildProcessHostImpl> process_; | 94 scoped_ptr<BrowserChildProcessHostImpl> process_; |
86 | 95 |
87 // Used in single-process mode instead of process_. | 96 // Used in single-process mode instead of process_. |
88 scoped_ptr<base::Thread> in_process_thread_; | 97 scoped_ptr<base::Thread> in_process_thread_; |
89 | 98 |
90 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); | 99 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); |
91 }; | 100 }; |
92 | 101 |
93 } // namespace content | 102 } // namespace content |
94 | 103 |
95 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ | 104 #endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ |
OLD | NEW |