Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: content/browser/mojo/mojo_shell_context.cc

Issue 1566253002: Move package_manager into mojo/shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/BUILD.gn ('k') | mandoline/app/android/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/gpu/gpu_process_host.h" 14 #include "content/browser/gpu/gpu_process_host.h"
15 #include "content/common/gpu/gpu_process_launch_causes.h" 15 #include "content/common/gpu/gpu_process_launch_causes.h"
16 #include "content/common/process_control.mojom.h" 16 #include "content/common/process_control.mojom.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/content_browser_client.h" 18 #include "content/public/browser/content_browser_client.h"
19 #include "content/public/browser/utility_process_host.h" 19 #include "content/public/browser/utility_process_host.h"
20 #include "content/public/browser/utility_process_host_client.h" 20 #include "content/public/browser/utility_process_host_client.h"
21 #include "content/public/common/content_client.h" 21 #include "content/public/common/content_client.h"
22 #include "content/public/common/service_registry.h" 22 #include "content/public/common/service_registry.h"
23 #include "mojo/application/public/cpp/application_delegate.h" 23 #include "mojo/application/public/cpp/application_delegate.h"
24 #include "mojo/common/url_type_converters.h" 24 #include "mojo/common/url_type_converters.h"
25 #include "mojo/package_manager/package_manager_impl.h"
26 #include "mojo/public/cpp/bindings/interface_request.h" 25 #include "mojo/public/cpp/bindings/interface_request.h"
27 #include "mojo/public/cpp/bindings/string.h" 26 #include "mojo/public/cpp/bindings/string.h"
28 #include "mojo/shell/application_loader.h" 27 #include "mojo/shell/application_loader.h"
29 #include "mojo/shell/connect_to_application_params.h" 28 #include "mojo/shell/connect_to_application_params.h"
30 #include "mojo/shell/identity.h" 29 #include "mojo/shell/identity.h"
30 #include "mojo/shell/package_manager/package_manager_impl.h"
31 #include "mojo/shell/static_application_loader.h" 31 #include "mojo/shell/static_application_loader.h"
32 32
33 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) || \ 33 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) || \
34 defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 34 defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
35 #include "media/mojo/services/mojo_media_application.h" 35 #include "media/mojo/services/mojo_media_application.h"
36 #endif 36 #endif
37 37
38 namespace content { 38 namespace content {
39 39
40 namespace { 40 namespace {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 void MojoShellContext::SetApplicationsForTest( 199 void MojoShellContext::SetApplicationsForTest(
200 const StaticApplicationMap* apps) { 200 const StaticApplicationMap* apps) {
201 g_applications_for_test = apps; 201 g_applications_for_test = apps;
202 } 202 }
203 203
204 MojoShellContext::MojoShellContext() { 204 MojoShellContext::MojoShellContext() {
205 proxy_.Get().reset(new Proxy(this)); 205 proxy_.Get().reset(new Proxy(this));
206 206
207 // Construct with an empty filepath since mojo: urls can't be registered now 207 // Construct with an empty filepath since mojo: urls can't be registered now
208 // the url scheme registry is locked. 208 // the url scheme registry is locked.
209 scoped_ptr<mojo::package_manager::PackageManagerImpl> package_manager( 209 scoped_ptr<mojo::shell::PackageManagerImpl> package_manager(
210 new mojo::package_manager::PackageManagerImpl(base::FilePath(), nullptr)); 210 new mojo::shell::PackageManagerImpl(base::FilePath(), nullptr));
211 application_manager_.reset( 211 application_manager_.reset(
212 new mojo::shell::ApplicationManager(std::move(package_manager))); 212 new mojo::shell::ApplicationManager(std::move(package_manager)));
213 213
214 application_manager_->set_default_loader( 214 application_manager_->set_default_loader(
215 scoped_ptr<mojo::shell::ApplicationLoader>(new DefaultApplicationLoader)); 215 scoped_ptr<mojo::shell::ApplicationLoader>(new DefaultApplicationLoader));
216 216
217 StaticApplicationMap apps; 217 StaticApplicationMap apps;
218 GetContentClient()->browser()->RegisterInProcessMojoApplications(&apps); 218 GetContentClient()->browser()->RegisterInProcessMojoApplications(&apps);
219 if (g_applications_for_test) { 219 if (g_applications_for_test) {
220 // Add testing apps to the map, potentially overwriting whatever the 220 // Add testing apps to the map, potentially overwriting whatever the
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 mojo::shell::GetPermissiveCapabilityFilter())); 294 mojo::shell::GetPermissiveCapabilityFilter()));
295 params->SetTarget(mojo::shell::Identity(url, std::string(), filter)); 295 params->SetTarget(mojo::shell::Identity(url, std::string(), filter));
296 params->set_services(std::move(request)); 296 params->set_services(std::move(request));
297 params->set_exposed_services(std::move(exposed_services)); 297 params->set_exposed_services(std::move(exposed_services));
298 params->set_on_application_end(base::Bind(&base::DoNothing)); 298 params->set_on_application_end(base::Bind(&base::DoNothing));
299 params->set_connect_callback(callback); 299 params->set_connect_callback(callback);
300 application_manager_->ConnectToApplication(std::move(params)); 300 application_manager_->ConnectToApplication(std::move(params));
301 } 301 }
302 302
303 } // namespace content 303 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | mandoline/app/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698