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 21 matching lines...) Expand all Loading... |
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/media/capture/audio_mirroring_manager.h" | 37 #include "content/browser/media/capture/audio_mirroring_manager.h" |
38 #include "content/browser/media/media_internals.h" | 38 #include "content/browser/media/media_internals.h" |
39 #include "content/browser/net/browser_online_state_observer.h" | 39 #include "content/browser/net/browser_online_state_observer.h" |
40 #include "content/browser/plugin_service_impl.h" | 40 #include "content/browser/plugin_service_impl.h" |
41 #include "content/browser/renderer_host/media/media_stream_manager.h" | 41 #include "content/browser/renderer_host/media/media_stream_manager.h" |
42 #include "content/browser/renderer_host/render_process_host_impl.h" | |
43 #include "content/browser/speech/speech_recognition_manager_impl.h" | 42 #include "content/browser/speech/speech_recognition_manager_impl.h" |
44 #include "content/browser/startup_task_runner.h" | 43 #include "content/browser/startup_task_runner.h" |
45 #include "content/browser/webui/content_web_ui_controller_factory.h" | 44 #include "content/browser/webui/content_web_ui_controller_factory.h" |
46 #include "content/browser/webui/url_data_manager.h" | 45 #include "content/browser/webui/url_data_manager.h" |
47 #include "content/public/browser/browser_main_parts.h" | 46 #include "content/public/browser/browser_main_parts.h" |
48 #include "content/public/browser/browser_shutdown.h" | 47 #include "content/public/browser/browser_shutdown.h" |
49 #include "content/public/browser/content_browser_client.h" | 48 #include "content/public/browser/content_browser_client.h" |
50 #include "content/public/browser/render_process_host.h" | 49 #include "content/public/browser/render_process_host.h" |
51 #include "content/public/browser/tracing_controller.h" | 50 #include "content/public/browser/tracing_controller.h" |
52 #include "content/public/common/content_switches.h" | 51 #include "content/public/common/content_switches.h" |
(...skipping 10 matching lines...) Expand all Loading... |
63 #include "ui/base/clipboard/clipboard.h" | 62 #include "ui/base/clipboard/clipboard.h" |
64 | 63 |
65 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 64 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
66 #include "content/browser/compositor/image_transport_factory.h" | 65 #include "content/browser/compositor/image_transport_factory.h" |
67 #endif | 66 #endif |
68 | 67 |
69 #if defined(USE_AURA) | 68 #if defined(USE_AURA) |
70 #include "ui/aura/env.h" | 69 #include "ui/aura/env.h" |
71 #endif | 70 #endif |
72 | 71 |
| 72 #if !defined(OS_IOS) |
| 73 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 74 #endif |
| 75 |
73 #if defined(OS_ANDROID) | 76 #if defined(OS_ANDROID) |
74 #include "base/android/jni_android.h" | 77 #include "base/android/jni_android.h" |
75 #include "content/browser/android/browser_startup_controller.h" | 78 #include "content/browser/android/browser_startup_controller.h" |
76 #include "content/browser/android/surface_texture_peer_browser_impl.h" | 79 #include "content/browser/android/surface_texture_peer_browser_impl.h" |
77 #include "content/browser/android/tracing_controller_android.h" | 80 #include "content/browser/android/tracing_controller_android.h" |
78 #include "ui/gl/gl_surface.h" | 81 #include "ui/gl/gl_surface.h" |
79 #endif | 82 #endif |
80 | 83 |
81 #if defined(OS_MACOSX) && !defined(OS_IOS) | 84 #if defined(OS_MACOSX) && !defined(OS_IOS) |
82 #include "content/browser/theme_helper_mac.h" | 85 #include "content/browser/theme_helper_mac.h" |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp") | 714 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp") |
712 | 715 |
713 // Teardown may start in PostMainMessageLoopRun, and during teardown we | 716 // Teardown may start in PostMainMessageLoopRun, and during teardown we |
714 // need to be able to perform IO. | 717 // need to be able to perform IO. |
715 base::ThreadRestrictions::SetIOAllowed(true); | 718 base::ThreadRestrictions::SetIOAllowed(true); |
716 BrowserThread::PostTask( | 719 BrowserThread::PostTask( |
717 BrowserThread::IO, FROM_HERE, | 720 BrowserThread::IO, FROM_HERE, |
718 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | 721 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), |
719 true)); | 722 true)); |
720 | 723 |
| 724 #if !defined(OS_IOS) |
721 if (RenderProcessHost::run_renderer_in_process()) | 725 if (RenderProcessHost::run_renderer_in_process()) |
722 RenderProcessHostImpl::ShutDownInProcessRenderer(); | 726 RenderProcessHostImpl::ShutDownInProcessRenderer(); |
| 727 #endif |
723 | 728 |
724 if (parts_) { | 729 if (parts_) { |
725 TRACE_EVENT0("shutdown", | 730 TRACE_EVENT0("shutdown", |
726 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); | 731 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); |
727 parts_->PostMainMessageLoopRun(); | 732 parts_->PostMainMessageLoopRun(); |
728 } | 733 } |
729 | 734 |
730 trace_memory_controller_.reset(); | 735 trace_memory_controller_.reset(); |
731 system_stats_monitor_.reset(); | 736 system_stats_monitor_.reset(); |
732 | 737 |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 base::TimeDelta::FromSeconds(delay_secs)); | 1113 base::TimeDelta::FromSeconds(delay_secs)); |
1109 } | 1114 } |
1110 | 1115 |
1111 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { | 1116 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { |
1112 is_tracing_startup_ = false; | 1117 is_tracing_startup_ = false; |
1113 TracingController::GetInstance()->DisableRecording( | 1118 TracingController::GetInstance()->DisableRecording( |
1114 trace_file, base::Bind(&OnStoppedStartupTracing)); | 1119 trace_file, base::Bind(&OnStoppedStartupTracing)); |
1115 } | 1120 } |
1116 | 1121 |
1117 } // namespace content | 1122 } // namespace content |
OLD | NEW |