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 20 matching lines...) Expand all Loading... | |
31 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 31 #include "mojo/services/tracing/public/interfaces/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/background_application_loader.h" | 34 #include "shell/background_application_loader.h" |
35 #include "shell/command_line_util.h" | 35 #include "shell/command_line_util.h" |
36 #include "shell/filename_util.h" | 36 #include "shell/filename_util.h" |
37 #include "shell/in_process_native_runner.h" | 37 #include "shell/in_process_native_runner.h" |
38 #include "shell/out_of_process_native_runner.h" | 38 #include "shell/out_of_process_native_runner.h" |
39 #include "shell/switches.h" | 39 #include "shell/switches.h" |
40 #include "shell/tracer.h" | 40 #include "shell/tracer.h" |
41 #include "url/gurl.h" | |
42 | |
43 #if !defined(OS_MACOSX) | |
viettrungluu
2015/09/10 18:11:09
You should include build/build_config.h.
viettrungluu
2015/09/14 16:35:32
You forgot this file.
| |
41 #include "shell/url_response_disk_cache_loader.h" | 44 #include "shell/url_response_disk_cache_loader.h" |
42 #include "url/gurl.h" | 45 #endif |
43 | 46 |
44 using mojo::ServiceProvider; | 47 using mojo::ServiceProvider; |
45 using mojo::ServiceProviderPtr; | 48 using mojo::ServiceProviderPtr; |
46 | 49 |
47 namespace shell { | 50 namespace shell { |
48 namespace { | 51 namespace { |
49 | 52 |
50 // Used to ensure we only init once. | 53 // Used to ensure we only init once. |
51 class Setup { | 54 class Setup { |
52 public: | 55 public: |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 *base::CommandLine::ForCurrentProcess(); | 268 *base::CommandLine::ForCurrentProcess(); |
266 | 269 |
267 if (command_line.HasSwitch(switches::kWaitForDebugger)) | 270 if (command_line.HasSwitch(switches::kWaitForDebugger)) |
268 base::debug::WaitForDebugger(60, true); | 271 base::debug::WaitForDebugger(60, true); |
269 | 272 |
270 mojo_shell_child_path_ = shell_child_path; | 273 mojo_shell_child_path_ = shell_child_path; |
271 | 274 |
272 task_runners_.reset( | 275 task_runners_.reset( |
273 new TaskRunners(base::MessageLoop::current()->message_loop_proxy())); | 276 new TaskRunners(base::MessageLoop::current()->message_loop_proxy())); |
274 | 277 |
278 #if !defined(OS_MACOSX) | |
275 application_manager()->SetLoaderForURL( | 279 application_manager()->SetLoaderForURL( |
276 make_scoped_ptr(new BackgroundApplicationLoader( | 280 make_scoped_ptr(new BackgroundApplicationLoader( |
277 make_scoped_ptr( | 281 make_scoped_ptr( |
278 new URLResponseDiskCacheLoader(task_runners_->blocking_pool())), | 282 new URLResponseDiskCacheLoader(task_runners_->blocking_pool())), |
279 "url_response_disk_cache", base::MessageLoop::TYPE_DEFAULT)), | 283 "url_response_disk_cache", base::MessageLoop::TYPE_DEFAULT)), |
280 GURL("mojo:url_response_disk_cache")); | 284 GURL("mojo:url_response_disk_cache")); |
285 #endif | |
281 | 286 |
282 EnsureEmbedderIsInitialized(); | 287 EnsureEmbedderIsInitialized(); |
283 | 288 |
284 // TODO(vtl): Probably these failures should be checked before |Init()|, and | 289 // TODO(vtl): Probably these failures should be checked before |Init()|, and |
285 // this function simply shouldn't fail. | 290 // this function simply shouldn't fail. |
286 if (!shell_file_root_.is_valid()) | 291 if (!shell_file_root_.is_valid()) |
287 return false; | 292 return false; |
288 if (!ConfigureURLMappings(command_line, this)) | 293 if (!ConfigureURLMappings(command_line, this)) |
289 return false; | 294 return false; |
290 | 295 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 app_urls_.erase(url); | 376 app_urls_.erase(url); |
372 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { | 377 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { |
373 DCHECK_EQ(base::MessageLoop::current()->task_runner(), | 378 DCHECK_EQ(base::MessageLoop::current()->task_runner(), |
374 task_runners_->shell_runner()); | 379 task_runners_->shell_runner()); |
375 base::MessageLoop::current()->Quit(); | 380 base::MessageLoop::current()->Quit(); |
376 } | 381 } |
377 } | 382 } |
378 } | 383 } |
379 | 384 |
380 } // namespace shell | 385 } // namespace shell |
OLD | NEW |