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 #include "content/browser/utility_process_host_impl.h" | 5 #include "content/browser/utility_process_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #elif defined(OS_POSIX) | 43 #elif defined(OS_POSIX) |
44 env_(env), | 44 env_(env), |
45 no_sandbox_(no_sandbox), | 45 no_sandbox_(no_sandbox), |
46 ipc_fd_(host->TakeClientFileDescriptor()) | 46 ipc_fd_(host->TakeClientFileDescriptor()) |
47 #endif // OS_WIN | 47 #endif // OS_WIN |
48 {} | 48 {} |
49 | 49 |
50 virtual ~UtilitySandboxedProcessLauncherDelegate() {} | 50 virtual ~UtilitySandboxedProcessLauncherDelegate() {} |
51 | 51 |
52 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
53 virtual bool ShouldLaunchElevated() OVERRIDE { | 53 virtual bool ShouldLaunchElevated() override { |
54 return launch_elevated_; | 54 return launch_elevated_; |
55 } | 55 } |
56 virtual void PreSandbox(bool* disable_default_policy, | 56 virtual void PreSandbox(bool* disable_default_policy, |
57 base::FilePath* exposed_dir) OVERRIDE { | 57 base::FilePath* exposed_dir) override { |
58 *exposed_dir = exposed_dir_; | 58 *exposed_dir = exposed_dir_; |
59 } | 59 } |
60 #elif defined(OS_POSIX) | 60 #elif defined(OS_POSIX) |
61 | 61 |
62 virtual bool ShouldUseZygote() OVERRIDE { | 62 virtual bool ShouldUseZygote() override { |
63 return !no_sandbox_ && exposed_dir_.empty(); | 63 return !no_sandbox_ && exposed_dir_.empty(); |
64 } | 64 } |
65 virtual base::EnvironmentMap GetEnvironment() OVERRIDE { | 65 virtual base::EnvironmentMap GetEnvironment() override { |
66 return env_; | 66 return env_; |
67 } | 67 } |
68 virtual int GetIpcFd() OVERRIDE { | 68 virtual int GetIpcFd() override { |
69 return ipc_fd_; | 69 return ipc_fd_; |
70 } | 70 } |
71 #endif // OS_WIN | 71 #endif // OS_WIN |
72 | 72 |
73 private: | 73 private: |
74 | 74 |
75 base::FilePath exposed_dir_; | 75 base::FilePath exposed_dir_; |
76 | 76 |
77 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
78 bool launch_elevated_; | 78 bool launch_elevated_; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 if (!client_.get()) | 295 if (!client_.get()) |
296 return; | 296 return; |
297 | 297 |
298 client_task_runner_->PostTask( | 298 client_task_runner_->PostTask( |
299 FROM_HERE, | 299 FROM_HERE, |
300 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), | 300 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), |
301 exit_code)); | 301 exit_code)); |
302 } | 302 } |
303 | 303 |
304 } // namespace content | 304 } // namespace content |
OLD | NEW |