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

Side by Side Diff: mojo/shell/application_manager.cc

Issue 1738663002: Hook embedded shell up to MojoShellConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « mojo/shell/application_manager.h ('k') | mojo/shell/runner/child/runner_connection.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/shell/application_manager.h" 5 #include "mojo/shell/application_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (ConnectToExistingInstance(&params)) 92 if (ConnectToExistingInstance(&params))
93 return; 93 return;
94 94
95 std::string url = params->target().url().spec(); 95 std::string url = params->target().url().spec();
96 shell_resolver_->ResolveMojoURL( 96 shell_resolver_->ResolveMojoURL(
97 url, 97 url,
98 base::Bind(&ApplicationManager::OnGotResolvedURL, 98 base::Bind(&ApplicationManager::OnGotResolvedURL,
99 weak_ptr_factory_.GetWeakPtr(), base::Passed(&params))); 99 weak_ptr_factory_.GetWeakPtr(), base::Passed(&params)));
100 } 100 }
101 101
102 mojom::ShellClientRequest ApplicationManager::InitInstanceForEmbedder(
103 const GURL& url) {
104 DCHECK(!embedder_instance_);
105
106 mojo::shell::Identity target(url, std::string(), mojom::Connector::kUserRoot);
107 target.SetFilter(GetPermissiveCapabilityFilter());
108 DCHECK(!GetApplicationInstance(target));
109
110 mojom::ShellClientRequest request;
111 embedder_instance_ = CreateInstance(target, &request);
112 DCHECK(embedder_instance_);
113
114 return request;
115 }
116
102 void ApplicationManager::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, 117 void ApplicationManager::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader,
103 const GURL& url) { 118 const GURL& url) {
104 URLToLoaderMap::iterator it = url_to_loader_.find(url); 119 URLToLoaderMap::iterator it = url_to_loader_.find(url);
105 if (it != url_to_loader_.end()) 120 if (it != url_to_loader_.end())
106 delete it->second; 121 delete it->second;
107 url_to_loader_[url] = loader.release(); 122 url_to_loader_[url] = loader.release();
108 } 123 }
109 124
110 void ApplicationManager::TerminateShellConnections() { 125 void ApplicationManager::TerminateShellConnections() {
111 STLDeleteValues(&identity_to_instance_); 126 STLDeleteValues(&identity_to_instance_);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 info->qualifier = instance->identity().qualifier(); 391 info->qualifier = instance->identity().qualifier();
377 if (instance->identity().url().spec() == "mojo://shell/") 392 if (instance->identity().url().spec() == "mojo://shell/")
378 info->pid = base::Process::Current().Pid(); 393 info->pid = base::Process::Current().Pid();
379 else 394 else
380 info->pid = instance->pid(); 395 info->pid = instance->pid();
381 return info; 396 return info;
382 } 397 }
383 398
384 } // namespace shell 399 } // namespace shell
385 } // namespace mojo 400 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/application_manager.h ('k') | mojo/shell/runner/child/runner_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698