OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
18 #include "content/browser/browser_thread_impl.h" | 18 #include "content/browser/browser_thread_impl.h" |
| 19 #include "content/browser/download/download_file_manager.h" |
19 #include "content/browser/download/save_file_manager.h" | 20 #include "content/browser/download/save_file_manager.h" |
20 #include "content/browser/gamepad/gamepad_service.h" | 21 #include "content/browser/gamepad/gamepad_service.h" |
21 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 22 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
22 #include "content/browser/gpu/gpu_process_host.h" | 23 #include "content/browser/gpu/gpu_process_host.h" |
23 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 24 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
24 #include "content/browser/histogram_synchronizer.h" | 25 #include "content/browser/histogram_synchronizer.h" |
25 #include "content/browser/in_process_webkit/webkit_thread.h" | 26 #include "content/browser/in_process_webkit/webkit_thread.h" |
26 #include "content/browser/net/browser_online_state_observer.h" | 27 #include "content/browser/net/browser_online_state_observer.h" |
27 #include "content/browser/plugin_service_impl.h" | 28 #include "content/browser/plugin_service_impl.h" |
28 #include "content/browser/renderer_host/media/audio_input_device_manager.h" | 29 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 resource_dispatcher_host_.reset(); | 546 resource_dispatcher_host_.reset(); |
546 break; | 547 break; |
547 case BrowserThread::FILE_USER_BLOCKING: | 548 case BrowserThread::FILE_USER_BLOCKING: |
548 thread_to_stop = &file_user_blocking_thread_; | 549 thread_to_stop = &file_user_blocking_thread_; |
549 break; | 550 break; |
550 case BrowserThread::FILE: | 551 case BrowserThread::FILE: |
551 thread_to_stop = &file_thread_; | 552 thread_to_stop = &file_thread_; |
552 | 553 |
553 // Clean up state that lives on or uses the file_thread_ before | 554 // Clean up state that lives on or uses the file_thread_ before |
554 // it goes away. | 555 // it goes away. |
555 if (resource_dispatcher_host_.get()) | 556 if (resource_dispatcher_host_.get()) { |
| 557 resource_dispatcher_host_.get()->download_file_manager()->Shutdown(); |
556 resource_dispatcher_host_.get()->save_file_manager()->Shutdown(); | 558 resource_dispatcher_host_.get()->save_file_manager()->Shutdown(); |
| 559 } |
557 break; | 560 break; |
558 case BrowserThread::PROCESS_LAUNCHER: | 561 case BrowserThread::PROCESS_LAUNCHER: |
559 thread_to_stop = &process_launcher_thread_; | 562 thread_to_stop = &process_launcher_thread_; |
560 break; | 563 break; |
561 case BrowserThread::CACHE: | 564 case BrowserThread::CACHE: |
562 thread_to_stop = &cache_thread_; | 565 thread_to_stop = &cache_thread_; |
563 break; | 566 break; |
564 case BrowserThread::IO: | 567 case BrowserThread::IO: |
565 thread_to_stop = &io_thread_; | 568 thread_to_stop = &io_thread_; |
566 break; | 569 break; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 681 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
679 if (parameters_.ui_task) | 682 if (parameters_.ui_task) |
680 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 683 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
681 | 684 |
682 base::RunLoop run_loop; | 685 base::RunLoop run_loop; |
683 run_loop.Run(); | 686 run_loop.Run(); |
684 #endif | 687 #endif |
685 } | 688 } |
686 | 689 |
687 } // namespace content | 690 } // namespace content |
OLD | NEW |