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

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

Issue 1052103005: Documents what ApplicationManager::Delegate do (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dont nuke Created 5 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 | « mojo/shell/context.h ('k') | mojo/shell/native_runner_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/context.h" 5 #include "mojo/shell/context.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 void Context::Shutdown() { 279 void Context::Shutdown() {
280 TRACE_EVENT0("mojo_shell", "Context::Shutdown"); 280 TRACE_EVENT0("mojo_shell", "Context::Shutdown");
281 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 281 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
282 task_runners_->shell_runner()); 282 task_runners_->shell_runner());
283 embedder::ShutdownIPCSupport(); 283 embedder::ShutdownIPCSupport();
284 // We'll quit when we get OnShutdownComplete(). 284 // We'll quit when we get OnShutdownComplete().
285 base::MessageLoop::current()->Run(); 285 base::MessageLoop::current()->Run();
286 } 286 }
287 287
288 GURL Context::ResolveURL(const GURL& url) {
289 return url_resolver_.ResolveMojoURL(url);
290 }
291
292 GURL Context::ResolveMappings(const GURL& url) { 288 GURL Context::ResolveMappings(const GURL& url) {
293 return url_resolver_.ApplyMappings(url); 289 return url_resolver_.ApplyMappings(url);
294 } 290 }
295 291
292 GURL Context::ResolveMojoURL(const GURL& url) {
293 return url_resolver_.ResolveMojoURL(url);
294 }
295
296 void Context::OnShutdownComplete() { 296 void Context::OnShutdownComplete() {
297 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 297 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
298 task_runners_->shell_runner()); 298 task_runners_->shell_runner());
299 base::MessageLoop::current()->Quit(); 299 base::MessageLoop::current()->Quit();
300 } 300 }
301 301
302 void Context::Run(const GURL& url) { 302 void Context::Run(const GURL& url) {
303 ServiceProviderPtr services; 303 ServiceProviderPtr services;
304 ServiceProviderPtr exposed_services; 304 ServiceProviderPtr exposed_services;
305 305
306 app_urls_.insert(url); 306 app_urls_.insert(url);
307 application_manager_.ConnectToApplication( 307 application_manager_.ConnectToApplication(
308 url, GURL(), GetProxy(&services), exposed_services.Pass(), 308 url, GURL(), GetProxy(&services), exposed_services.Pass(),
309 base::Bind(&Context::OnApplicationEnd, base::Unretained(this), url)); 309 base::Bind(&Context::OnApplicationEnd, base::Unretained(this), url));
310 } 310 }
311 311
312 void Context::OnApplicationEnd(const GURL& url) { 312 void Context::OnApplicationEnd(const GURL& url) {
313 if (app_urls_.find(url) != app_urls_.end()) { 313 if (app_urls_.find(url) != app_urls_.end()) {
314 app_urls_.erase(url); 314 app_urls_.erase(url);
315 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { 315 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) {
316 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 316 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
317 task_runners_->shell_runner()); 317 task_runners_->shell_runner());
318 base::MessageLoop::current()->Quit(); 318 base::MessageLoop::current()->Quit();
319 } 319 }
320 } 320 }
321 } 321 }
322 322
323 } // namespace shell 323 } // namespace shell
324 } // namespace mojo 324 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/native_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698