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

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
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (ConnectToExistingInstance(&params)) 91 if (ConnectToExistingInstance(&params))
92 return; 92 return;
93 93
94 std::string url = params->target().url().spec(); 94 std::string url = params->target().url().spec();
95 shell_resolver_->ResolveMojoURL( 95 shell_resolver_->ResolveMojoURL(
96 url, 96 url,
97 base::Bind(&ApplicationManager::OnGotResolvedURL, 97 base::Bind(&ApplicationManager::OnGotResolvedURL,
98 weak_ptr_factory_.GetWeakPtr(), base::Passed(&params))); 98 weak_ptr_factory_.GetWeakPtr(), base::Passed(&params)));
99 } 99 }
100 100
101 mojom::ShellClientRequest ApplicationManager::InitInstanceForEmbedder(
102 const GURL& url) {
103 DCHECK(!embedder_instance_);
104
105 mojo::shell::Identity target(url, std::string(), mojom::Shell::kUserRoot,
106 GetPermissiveCapabilityFilter());
107 DCHECK(!GetApplicationInstance(target));
108
109 mojom::ShellClientRequest request;
110 embedder_instance_ = CreateInstance(target, &request);
111 DCHECK(embedder_instance_);
112
113 return request;
114 }
115
101 void ApplicationManager::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, 116 void ApplicationManager::SetLoaderForURL(scoped_ptr<ApplicationLoader> loader,
102 const GURL& url) { 117 const GURL& url) {
103 URLToLoaderMap::iterator it = url_to_loader_.find(url); 118 URLToLoaderMap::iterator it = url_to_loader_.find(url);
104 if (it != url_to_loader_.end()) 119 if (it != url_to_loader_.end())
105 delete it->second; 120 delete it->second;
106 url_to_loader_[url] = loader.release(); 121 url_to_loader_[url] = loader.release();
107 } 122 }
108 123
109 void ApplicationManager::TerminateShellConnections() { 124 void ApplicationManager::TerminateShellConnections() {
110 STLDeleteValues(&identity_to_instance_); 125 STLDeleteValues(&identity_to_instance_);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 info->qualifier = instance->identity().qualifier(); 388 info->qualifier = instance->identity().qualifier();
374 if (instance->identity().url().spec() == "mojo://shell/") 389 if (instance->identity().url().spec() == "mojo://shell/")
375 info->pid = base::Process::Current().Pid(); 390 info->pid = base::Process::Current().Pid();
376 else 391 else
377 info->pid = instance->pid(); 392 info->pid = instance->pid();
378 return info; 393 return info;
379 } 394 }
380 395
381 } // namespace shell 396 } // namespace shell
382 } // namespace mojo 397 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698