| OLD | NEW |
| 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/runner/context.h" | 5 #include "mojo/runner/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 11 matching lines...) Expand all Loading... |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "components/devtools_service/public/cpp/switches.h" | 23 #include "components/devtools_service/public/cpp/switches.h" |
| 24 #include "components/devtools_service/public/interfaces/devtools_service.mojom.h
" | 24 #include "components/devtools_service/public/interfaces/devtools_service.mojom.h
" |
| 25 #include "mojo/application/public/cpp/application_connection.h" | 25 #include "mojo/application/public/cpp/application_connection.h" |
| 26 #include "mojo/application/public/cpp/application_delegate.h" | 26 #include "mojo/application/public/cpp/application_delegate.h" |
| 27 #include "mojo/application/public/cpp/application_impl.h" | 27 #include "mojo/application/public/cpp/application_impl.h" |
| 28 #include "mojo/common/trace_controller_impl.h" | 28 #include "mojo/common/trace_controller_impl.h" |
| 29 #include "mojo/common/tracing_impl.h" | 29 #include "mojo/common/tracing_impl.h" |
| 30 #include "mojo/edk/embedder/embedder.h" | 30 #include "mojo/edk/embedder/embedder.h" |
| 31 #include "mojo/edk/embedder/simple_platform_support.h" | 31 #include "mojo/edk/embedder/simple_platform_support.h" |
| 32 #include "mojo/runner/about_fetcher.h" |
| 32 #include "mojo/runner/in_process_native_runner.h" | 33 #include "mojo/runner/in_process_native_runner.h" |
| 33 #include "mojo/runner/out_of_process_native_runner.h" | 34 #include "mojo/runner/out_of_process_native_runner.h" |
| 34 #include "mojo/runner/switches.h" | 35 #include "mojo/runner/switches.h" |
| 35 #include "mojo/services/tracing/tracing.mojom.h" | 36 #include "mojo/services/tracing/tracing.mojom.h" |
| 36 #include "mojo/shell/application_loader.h" | 37 #include "mojo/shell/application_loader.h" |
| 37 #include "mojo/shell/application_manager.h" | 38 #include "mojo/shell/application_manager.h" |
| 38 #include "mojo/shell/switches.h" | 39 #include "mojo/shell/switches.h" |
| 39 #include "mojo/util/filename_util.h" | 40 #include "mojo/util/filename_util.h" |
| 40 #include "url/gurl.h" | 41 #include "url/gurl.h" |
| 41 | 42 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 return url_resolver_.ApplyMappings(url); | 331 return url_resolver_.ApplyMappings(url); |
| 331 } | 332 } |
| 332 | 333 |
| 333 GURL Context::ResolveMojoURL(const GURL& url) { | 334 GURL Context::ResolveMojoURL(const GURL& url) { |
| 334 return url_resolver_.ResolveMojoURL(url); | 335 return url_resolver_.ResolveMojoURL(url); |
| 335 } | 336 } |
| 336 | 337 |
| 337 bool Context::CreateFetcher( | 338 bool Context::CreateFetcher( |
| 338 const GURL& url, | 339 const GURL& url, |
| 339 const shell::Fetcher::FetchCallback& loader_callback) { | 340 const shell::Fetcher::FetchCallback& loader_callback) { |
| 341 if (url.SchemeIs(AboutFetcher::kAboutScheme)) { |
| 342 AboutFetcher::Start(url, loader_callback); |
| 343 return true; |
| 344 } |
| 345 |
| 340 return false; | 346 return false; |
| 341 } | 347 } |
| 342 | 348 |
| 343 void Context::OnShutdownComplete() { | 349 void Context::OnShutdownComplete() { |
| 344 DCHECK_EQ(base::MessageLoop::current()->task_runner(), | 350 DCHECK_EQ(base::MessageLoop::current()->task_runner(), |
| 345 task_runners_->shell_runner()); | 351 task_runners_->shell_runner()); |
| 346 base::MessageLoop::current()->Quit(); | 352 base::MessageLoop::current()->Quit(); |
| 347 } | 353 } |
| 348 | 354 |
| 349 void Context::Run(const GURL& url) { | 355 void Context::Run(const GURL& url) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 base::MessageLoop::current()->Quit(); | 391 base::MessageLoop::current()->Quit(); |
| 386 } else { | 392 } else { |
| 387 app_complete_callback_.Run(); | 393 app_complete_callback_.Run(); |
| 388 } | 394 } |
| 389 } | 395 } |
| 390 } | 396 } |
| 391 } | 397 } |
| 392 | 398 |
| 393 } // namespace runner | 399 } // namespace runner |
| 394 } // namespace mojo | 400 } // namespace mojo |
| OLD | NEW |