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

Side by Side Diff: content/child/process_control_impl.cc

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/child/process_control_impl.h ('k') | content/common/application_setup.mojom » ('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/child/process_control_impl.h" 5 #include "content/child/process_control_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/common/mojo/static_loader.h" 10 #include "content/common/mojo/static_loader.h"
11 #include "content/public/common/content_client.h" 11 #include "content/public/common/content_client.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 ProcessControlImpl::ProcessControlImpl() { 15 ProcessControlImpl::ProcessControlImpl() {
16 } 16 }
17 17
18 ProcessControlImpl::~ProcessControlImpl() { 18 ProcessControlImpl::~ProcessControlImpl() {
19 STLDeleteValues(&name_to_loader_map_); 19 STLDeleteValues(&name_to_loader_map_);
20 } 20 }
21 21
22 void ProcessControlImpl::LoadApplication( 22 void ProcessControlImpl::LoadApplication(
23 const mojo::String& name, 23 const mojo::String& name,
24 mojo::InterfaceRequest<mojo::shell::mojom::ShellClient> request, 24 mojo::InterfaceRequest<shell::mojom::ShellClient> request,
25 const LoadApplicationCallback& callback) { 25 const LoadApplicationCallback& callback) {
26 // Only register loaders when we need it. 26 // Only register loaders when we need it.
27 if (!has_registered_loaders_) { 27 if (!has_registered_loaders_) {
28 DCHECK(name_to_loader_map_.empty()); 28 DCHECK(name_to_loader_map_.empty());
29 RegisterLoaders(&name_to_loader_map_); 29 RegisterLoaders(&name_to_loader_map_);
30 has_registered_loaders_ = true; 30 has_registered_loaders_ = true;
31 } 31 }
32 32
33 auto it = name_to_loader_map_.find(name); 33 auto it = name_to_loader_map_.find(name);
34 if (it == name_to_loader_map_.end()) { 34 if (it == name_to_loader_map_.end()) {
35 callback.Run(false); 35 callback.Run(false);
36 OnLoadFailed(); 36 OnLoadFailed();
37 return; 37 return;
38 } 38 }
39 39
40 callback.Run(true); 40 callback.Run(true);
41 it->second->Load(name, std::move(request)); 41 it->second->Load(name, std::move(request));
42 } 42 }
43 43
44 } // namespace content 44 } // namespace content
OLDNEW
« no previous file with comments | « content/child/process_control_impl.h ('k') | content/common/application_setup.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698