| 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" | |
| 20 #include "content/browser/download/save_file_manager.h" | 19 #include "content/browser/download/save_file_manager.h" |
| 21 #include "content/browser/gamepad/gamepad_service.h" | 20 #include "content/browser/gamepad/gamepad_service.h" |
| 22 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 21 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 23 #include "content/browser/gpu/gpu_data_manager_impl.h" | 22 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 24 #include "content/browser/gpu/gpu_process_host.h" | 23 #include "content/browser/gpu/gpu_process_host.h" |
| 25 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 24 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 26 #include "content/browser/histogram_synchronizer.h" | 25 #include "content/browser/histogram_synchronizer.h" |
| 27 #include "content/browser/in_process_webkit/webkit_thread.h" | 26 #include "content/browser/in_process_webkit/webkit_thread.h" |
| 28 #include "content/browser/net/browser_online_state_observer.h" | 27 #include "content/browser/net/browser_online_state_observer.h" |
| 29 #include "content/browser/plugin_service_impl.h" | 28 #include "content/browser/plugin_service_impl.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 break; | 563 break; |
| 565 case BrowserThread::FILE_USER_BLOCKING: | 564 case BrowserThread::FILE_USER_BLOCKING: |
| 566 thread_to_stop = &file_user_blocking_thread_; | 565 thread_to_stop = &file_user_blocking_thread_; |
| 567 break; | 566 break; |
| 568 case BrowserThread::FILE: | 567 case BrowserThread::FILE: |
| 569 thread_to_stop = &file_thread_; | 568 thread_to_stop = &file_thread_; |
| 570 | 569 |
| 571 #if !defined(OS_IOS) | 570 #if !defined(OS_IOS) |
| 572 // Clean up state that lives on or uses the file_thread_ before | 571 // Clean up state that lives on or uses the file_thread_ before |
| 573 // it goes away. | 572 // it goes away. |
| 574 if (resource_dispatcher_host_.get()) { | 573 if (resource_dispatcher_host_.get()) |
| 575 resource_dispatcher_host_.get()->download_file_manager()->Shutdown(); | |
| 576 resource_dispatcher_host_.get()->save_file_manager()->Shutdown(); | 574 resource_dispatcher_host_.get()->save_file_manager()->Shutdown(); |
| 577 } | |
| 578 #endif // !defined(OS_IOS) | 575 #endif // !defined(OS_IOS) |
| 579 break; | 576 break; |
| 580 case BrowserThread::PROCESS_LAUNCHER: | 577 case BrowserThread::PROCESS_LAUNCHER: |
| 581 thread_to_stop = &process_launcher_thread_; | 578 thread_to_stop = &process_launcher_thread_; |
| 582 break; | 579 break; |
| 583 case BrowserThread::CACHE: | 580 case BrowserThread::CACHE: |
| 584 thread_to_stop = &cache_thread_; | 581 thread_to_stop = &cache_thread_; |
| 585 break; | 582 break; |
| 586 case BrowserThread::IO: | 583 case BrowserThread::IO: |
| 587 thread_to_stop = &io_thread_; | 584 thread_to_stop = &io_thread_; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 719 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 723 if (parameters_.ui_task) | 720 if (parameters_.ui_task) |
| 724 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 721 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
| 725 | 722 |
| 726 base::RunLoop run_loop; | 723 base::RunLoop run_loop; |
| 727 run_loop.Run(); | 724 run_loop.Run(); |
| 728 #endif | 725 #endif |
| 729 } | 726 } |
| 730 | 727 |
| 731 } // namespace content | 728 } // namespace content |
| OLD | NEW |