| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mojo/mojo_shell_context.h" | 5 #include "content/browser/mojo/mojo_shell_context.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 14 #include "components/profile_service/profile_app.h" |
| 14 #include "content/browser/gpu/gpu_process_host.h" | 15 #include "content/browser/gpu/gpu_process_host.h" |
| 15 #include "content/common/gpu/gpu_process_launch_causes.h" | 16 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 16 #include "content/common/mojo/mojo_shell_connection_impl.h" | 17 #include "content/common/mojo/mojo_shell_connection_impl.h" |
| 17 #include "content/common/mojo/static_loader.h" | 18 #include "content/common/mojo/static_loader.h" |
| 18 #include "content/common/process_control.mojom.h" | 19 #include "content/common/process_control.mojom.h" |
| 19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/content_browser_client.h" | 21 #include "content/public/browser/content_browser_client.h" |
| 21 #include "content/public/browser/utility_process_host.h" | 22 #include "content/public/browser/utility_process_host.h" |
| 22 #include "content/public/browser/utility_process_host_client.h" | 23 #include "content/public/browser/utility_process_host_client.h" |
| 23 #include "content/public/common/content_client.h" | 24 #include "content/public/common/content_client.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 make_scoped_ptr( | 244 make_scoped_ptr( |
| 244 new UtilityProcessLoader(app.second, false /* use_sandbox */)), | 245 new UtilityProcessLoader(app.second, false /* use_sandbox */)), |
| 245 app.first); | 246 app.first); |
| 246 } | 247 } |
| 247 | 248 |
| 248 #if (ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 249 #if (ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
| 249 application_manager_->SetLoaderForName(make_scoped_ptr(new GpuProcessLoader), | 250 application_manager_->SetLoaderForName(make_scoped_ptr(new GpuProcessLoader), |
| 250 "mojo:media"); | 251 "mojo:media"); |
| 251 #endif | 252 #endif |
| 252 | 253 |
| 254 base::Callback<scoped_ptr<mojo::ShellClient>()> profile_callback = |
| 255 base::Bind(&profile::CreateProfileApp); |
| 256 application_manager_->SetLoaderForName( |
| 257 make_scoped_ptr(new StaticLoader(profile_callback)), "mojo:profile"); |
| 258 |
| 253 if (!IsRunningInMojoShell()) { | 259 if (!IsRunningInMojoShell()) { |
| 254 MojoShellConnectionImpl::Create( | 260 MojoShellConnectionImpl::Create( |
| 255 application_manager_->InitInstanceForEmbedder(kBrowserAppName)); | 261 application_manager_->InitInstanceForEmbedder(kBrowserAppName)); |
| 256 } | 262 } |
| 257 } | 263 } |
| 258 | 264 |
| 259 MojoShellContext::~MojoShellContext() { | 265 MojoShellContext::~MojoShellContext() { |
| 260 if (!IsRunningInMojoShell()) | 266 if (!IsRunningInMojoShell()) |
| 261 MojoShellConnectionImpl::Destroy(); | 267 MojoShellConnectionImpl::Destroy(); |
| 262 } | 268 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 289 params->set_source(source_id); | 295 params->set_source(source_id); |
| 290 params->set_target(mojo::shell::Identity( | 296 params->set_target(mojo::shell::Identity( |
| 291 name, std::string(), mojo::shell::mojom::Connector::kUserRoot)); | 297 name, std::string(), mojo::shell::mojom::Connector::kUserRoot)); |
| 292 params->set_remote_interfaces(std::move(request)); | 298 params->set_remote_interfaces(std::move(request)); |
| 293 params->set_local_interfaces(std::move(exposed_services)); | 299 params->set_local_interfaces(std::move(exposed_services)); |
| 294 params->set_connect_callback(callback); | 300 params->set_connect_callback(callback); |
| 295 application_manager_->Connect(std::move(params)); | 301 application_manager_->Connect(std::move(params)); |
| 296 } | 302 } |
| 297 | 303 |
| 298 } // namespace content | 304 } // namespace content |
| OLD | NEW |