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 "shell/context.h" | 5 #include "shell/context.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "mojo/common/trace_controller_impl.h" | 24 #include "mojo/common/trace_controller_impl.h" |
25 #include "mojo/common/tracing_impl.h" | 25 #include "mojo/common/tracing_impl.h" |
26 #include "mojo/edk/embedder/embedder.h" | 26 #include "mojo/edk/embedder/embedder.h" |
27 #include "mojo/edk/embedder/simple_platform_support.h" | 27 #include "mojo/edk/embedder/simple_platform_support.h" |
28 #include "mojo/public/cpp/application/application_connection.h" | 28 #include "mojo/public/cpp/application/application_connection.h" |
29 #include "mojo/public/cpp/application/application_delegate.h" | 29 #include "mojo/public/cpp/application/application_delegate.h" |
30 #include "mojo/public/cpp/application/application_impl.h" | 30 #include "mojo/public/cpp/application/application_impl.h" |
31 #include "services/tracing/tracing.mojom.h" | 31 #include "services/tracing/tracing.mojom.h" |
32 #include "shell/application_manager/application_loader.h" | 32 #include "shell/application_manager/application_loader.h" |
33 #include "shell/application_manager/application_manager.h" | 33 #include "shell/application_manager/application_manager.h" |
34 #include "shell/authenticating_url_loader_loader.h" | |
35 #include "shell/background_application_loader.h" | 34 #include "shell/background_application_loader.h" |
36 #include "shell/command_line_util.h" | 35 #include "shell/command_line_util.h" |
37 #include "shell/filename_util.h" | 36 #include "shell/filename_util.h" |
38 #include "shell/in_process_native_runner.h" | 37 #include "shell/in_process_native_runner.h" |
39 #include "shell/out_of_process_native_runner.h" | 38 #include "shell/out_of_process_native_runner.h" |
40 #include "shell/switches.h" | 39 #include "shell/switches.h" |
41 #include "shell/tracer.h" | 40 #include "shell/tracer.h" |
42 #include "shell/url_response_disk_cache_loader.h" | 41 #include "shell/url_response_disk_cache_loader.h" |
43 #include "url/gurl.h" | 42 #include "url/gurl.h" |
44 | 43 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 base::debug::WaitForDebugger(60, true); | 271 base::debug::WaitForDebugger(60, true); |
273 | 272 |
274 mojo_shell_child_path_ = shell_child_path; | 273 mojo_shell_child_path_ = shell_child_path; |
275 | 274 |
276 application_manager()->SetLoaderForURL( | 275 application_manager()->SetLoaderForURL( |
277 make_scoped_ptr(new BackgroundApplicationLoader( | 276 make_scoped_ptr(new BackgroundApplicationLoader( |
278 make_scoped_ptr(new URLResponseDiskCacheLoader()), | 277 make_scoped_ptr(new URLResponseDiskCacheLoader()), |
279 "url_response_disk_cache", base::MessageLoop::TYPE_DEFAULT)), | 278 "url_response_disk_cache", base::MessageLoop::TYPE_DEFAULT)), |
280 GURL("mojo:url_response_disk_cache")); | 279 GURL("mojo:url_response_disk_cache")); |
281 | 280 |
282 application_manager()->SetLoaderForURL( | |
283 make_scoped_ptr(new BackgroundApplicationLoader( | |
284 make_scoped_ptr(new AuthenticatingURLLoaderLoader()), | |
285 "authenticating_url_loader", base::MessageLoop::TYPE_DEFAULT)), | |
286 GURL("mojo:authenticating_url_loader")); | |
287 | |
288 EnsureEmbedderIsInitialized(); | 281 EnsureEmbedderIsInitialized(); |
289 task_runners_.reset( | 282 task_runners_.reset( |
290 new TaskRunners(base::MessageLoop::current()->message_loop_proxy())); | 283 new TaskRunners(base::MessageLoop::current()->message_loop_proxy())); |
291 | 284 |
292 // TODO(vtl): Probably these failures should be checked before |Init()|, and | 285 // TODO(vtl): Probably these failures should be checked before |Init()|, and |
293 // this function simply shouldn't fail. | 286 // this function simply shouldn't fail. |
294 if (!shell_file_root_.is_valid()) | 287 if (!shell_file_root_.is_valid()) |
295 return false; | 288 return false; |
296 if (!ConfigureURLMappings(command_line, this)) | 289 if (!ConfigureURLMappings(command_line, this)) |
297 return false; | 290 return false; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 app_urls_.erase(url); | 365 app_urls_.erase(url); |
373 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { | 366 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { |
374 DCHECK_EQ(base::MessageLoop::current()->task_runner(), | 367 DCHECK_EQ(base::MessageLoop::current()->task_runner(), |
375 task_runners_->shell_runner()); | 368 task_runners_->shell_runner()); |
376 base::MessageLoop::current()->Quit(); | 369 base::MessageLoop::current()->Quit(); |
377 } | 370 } |
378 } | 371 } |
379 } | 372 } |
380 | 373 |
381 } // namespace shell | 374 } // namespace shell |
OLD | NEW |