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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
31 #include "content/public/browser/content_browser_client.h" | 31 #include "content/public/browser/content_browser_client.h" |
32 #include "content/public/browser/utility_process_host_client.h" | 32 #include "content/public/browser/utility_process_host_client.h" |
33 #include "content/public/common/content_switches.h" | 33 #include "content/public/common/content_switches.h" |
34 #include "content/public/common/mojo_channel_switches.h" | 34 #include "content/public/common/mojo_channel_switches.h" |
35 #include "content/public/common/process_type.h" | 35 #include "content/public/common/process_type.h" |
36 #include "content/public/common/sandbox_type.h" | 36 #include "content/public/common/sandbox_type.h" |
37 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 37 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
38 #include "ipc/ipc_switches.h" | 38 #include "ipc/ipc_switches.h" |
39 #include "mojo/edk/embedder/embedder.h" | 39 #include "mojo/edk/embedder/embedder.h" |
| 40 #include "services/shell/public/cpp/interface_provider.h" |
| 41 #include "services/shell/public/cpp/interface_registry.h" |
40 #include "ui/base/ui_base_switches.h" | 42 #include "ui/base/ui_base_switches.h" |
41 | 43 |
42 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 44 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
43 #include "content/public/browser/zygote_handle_linux.h" | 45 #include "content/public/browser/zygote_handle_linux.h" |
44 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 46 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
45 | 47 |
46 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
47 #include "sandbox/win/src/sandbox_policy.h" | 49 #include "sandbox/win/src/sandbox_policy.h" |
48 #include "sandbox/win/src/sandbox_types.h" | 50 #include "sandbox/win/src/sandbox_types.h" |
49 #endif | 51 #endif |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 void UtilityProcessHostImpl::SetEnv(const base::EnvironmentMap& env) { | 220 void UtilityProcessHostImpl::SetEnv(const base::EnvironmentMap& env) { |
219 env_ = env; | 221 env_ = env; |
220 } | 222 } |
221 | 223 |
222 #endif // OS_POSIX | 224 #endif // OS_POSIX |
223 | 225 |
224 bool UtilityProcessHostImpl::Start() { | 226 bool UtilityProcessHostImpl::Start() { |
225 return StartProcess(); | 227 return StartProcess(); |
226 } | 228 } |
227 | 229 |
228 ServiceRegistry* UtilityProcessHostImpl::GetServiceRegistry() { | 230 shell::InterfaceRegistry* UtilityProcessHostImpl::GetInterfaceRegistry() { |
229 DCHECK(mojo_application_host_); | 231 DCHECK(mojo_application_host_); |
230 return mojo_application_host_->service_registry(); | 232 return mojo_application_host_->interface_registry(); |
| 233 } |
| 234 |
| 235 shell::InterfaceProvider* UtilityProcessHostImpl::GetRemoteInterfaces() { |
| 236 DCHECK(mojo_application_host_); |
| 237 return mojo_application_host_->remote_interfaces(); |
231 } | 238 } |
232 | 239 |
233 void UtilityProcessHostImpl::SetName(const base::string16& name) { | 240 void UtilityProcessHostImpl::SetName(const base::string16& name) { |
234 name_ = name; | 241 name_ = name; |
235 } | 242 } |
236 | 243 |
237 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 244 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
238 // static | 245 // static |
239 void UtilityProcessHostImpl::EarlyZygoteLaunch() { | 246 void UtilityProcessHostImpl::EarlyZygoteLaunch() { |
240 DCHECK(!g_utility_zygote); | 247 DCHECK(!g_utility_zygote); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 base::WeakPtr<UtilityProcessHostImpl> host, | 419 base::WeakPtr<UtilityProcessHostImpl> host, |
413 int error_code) { | 420 int error_code) { |
414 if (!host) | 421 if (!host) |
415 return; | 422 return; |
416 | 423 |
417 host->OnProcessLaunchFailed(error_code); | 424 host->OnProcessLaunchFailed(error_code); |
418 delete host.get(); | 425 delete host.get(); |
419 } | 426 } |
420 | 427 |
421 } // namespace content | 428 } // namespace content |
OLD | NEW |