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

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

Issue 1295363003: Add ProcessControlImpl, the default ProcessControl implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 4 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/content_child.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/child/process_control_impl.h"
6
7 #include "base/stl_util.h"
8 #include "content/public/common/content_client.h"
9 #include "mojo/shell/static_application_loader.h"
10 #include "url/gurl.h"
11
12 namespace content {
13
14 ProcessControlImpl::ProcessControlImpl() {
15 }
16
17 ProcessControlImpl::~ProcessControlImpl() {
18 STLDeleteValues(&url_to_loader_map_);
19 }
20
21 void ProcessControlImpl::LoadApplication(
22 const mojo::String& url,
23 mojo::InterfaceRequest<mojo::Application> request,
24 const LoadApplicationCallback& callback) {
25 // Only register loaders when we need it.
26 if (!has_registered_loaders_) {
27 DCHECK(url_to_loader_map_.empty());
28 RegisterApplicationLoaders(&url_to_loader_map_);
29 has_registered_loaders_ = true;
30 }
31
32 GURL application_url = GURL(url.To<std::string>());
33 auto it = url_to_loader_map_.find(application_url);
34 if (it == url_to_loader_map_.end()) {
35 callback.Run(false);
36 return;
37 }
38
39 callback.Run(true);
40 it->second->Load(application_url, request.Pass());
41 }
42
43 } // namespace content
OLDNEW
« no previous file with comments | « content/child/process_control_impl.h ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698