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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "content/browser/gpu/compositor_util.h" | 31 #include "content/browser/gpu/compositor_util.h" |
32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 32 #include "content/browser/gpu/gpu_data_manager_impl.h" |
33 #include "content/browser/gpu/gpu_process_host.h" | 33 #include "content/browser/gpu/gpu_process_host.h" |
34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
35 #include "content/browser/histogram_synchronizer.h" | 35 #include "content/browser/histogram_synchronizer.h" |
36 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 36 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
37 #include "content/browser/net/browser_online_state_observer.h" | 37 #include "content/browser/net/browser_online_state_observer.h" |
38 #include "content/browser/plugin_service_impl.h" | 38 #include "content/browser/plugin_service_impl.h" |
39 #include "content/browser/renderer_host/media/audio_mirroring_manager.h" | 39 #include "content/browser/renderer_host/media/audio_mirroring_manager.h" |
40 #include "content/browser/renderer_host/media/media_stream_manager.h" | 40 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 41 #include "content/browser/renderer_host/render_process_host_impl.h" |
41 #include "content/browser/speech/speech_recognition_manager_impl.h" | 42 #include "content/browser/speech/speech_recognition_manager_impl.h" |
42 #include "content/browser/startup_task_runner.h" | 43 #include "content/browser/startup_task_runner.h" |
43 #include "content/browser/tracing/trace_controller_impl.h" | 44 #include "content/browser/tracing/trace_controller_impl.h" |
44 #include "content/browser/webui/content_web_ui_controller_factory.h" | 45 #include "content/browser/webui/content_web_ui_controller_factory.h" |
45 #include "content/browser/webui/url_data_manager.h" | 46 #include "content/browser/webui/url_data_manager.h" |
46 #include "content/public/browser/browser_main_parts.h" | 47 #include "content/public/browser/browser_main_parts.h" |
47 #include "content/public/browser/browser_shutdown.h" | 48 #include "content/public/browser/browser_shutdown.h" |
48 #include "content/public/browser/content_browser_client.h" | 49 #include "content/public/browser/content_browser_client.h" |
49 #include "content/public/browser/render_process_host.h" | 50 #include "content/public/browser/render_process_host.h" |
50 #include "content/public/common/content_switches.h" | 51 #include "content/public/common/content_switches.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp") | 734 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp") |
734 | 735 |
735 // Teardown may start in PostMainMessageLoopRun, and during teardown we | 736 // Teardown may start in PostMainMessageLoopRun, and during teardown we |
736 // need to be able to perform IO. | 737 // need to be able to perform IO. |
737 base::ThreadRestrictions::SetIOAllowed(true); | 738 base::ThreadRestrictions::SetIOAllowed(true); |
738 BrowserThread::PostTask( | 739 BrowserThread::PostTask( |
739 BrowserThread::IO, FROM_HERE, | 740 BrowserThread::IO, FROM_HERE, |
740 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | 741 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), |
741 true)); | 742 true)); |
742 | 743 |
743 if (RenderProcessHost::run_renderer_in_process() && | 744 if (RenderProcessHost::run_renderer_in_process()) |
744 !RenderProcessHost::AllHostsIterator().IsAtEnd()) { | 745 RenderProcessHostImpl::ShutDownInProcessRenderer(); |
745 delete RenderProcessHost::AllHostsIterator().GetCurrentValue(); | |
746 } | |
747 | 746 |
748 if (parts_) { | 747 if (parts_) { |
749 TRACE_EVENT0("shutdown", | 748 TRACE_EVENT0("shutdown", |
750 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); | 749 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); |
751 parts_->PostMainMessageLoopRun(); | 750 parts_->PostMainMessageLoopRun(); |
752 } | 751 } |
753 | 752 |
754 trace_memory_controller_.reset(); | 753 trace_memory_controller_.reset(); |
755 system_stats_monitor_.reset(); | 754 system_stats_monitor_.reset(); |
756 | 755 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 if (parameters_.ui_task) | 1068 if (parameters_.ui_task) |
1070 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 1069 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
1071 *parameters_.ui_task); | 1070 *parameters_.ui_task); |
1072 | 1071 |
1073 base::RunLoop run_loop; | 1072 base::RunLoop run_loop; |
1074 run_loop.Run(); | 1073 run_loop.Run(); |
1075 #endif | 1074 #endif |
1076 } | 1075 } |
1077 | 1076 |
1078 } // namespace content | 1077 } // namespace content |
OLD | NEW |