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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/memory_pressure_monitor.h" | 10 #include "base/memory/memory_pressure_monitor.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "content/browser/gamepad/gamepad_service.h" | 32 #include "content/browser/gamepad/gamepad_service.h" |
33 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 33 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
34 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 34 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
35 #include "content/browser/gpu/compositor_util.h" | 35 #include "content/browser/gpu/compositor_util.h" |
36 #include "content/browser/gpu/gpu_data_manager_impl.h" | 36 #include "content/browser/gpu/gpu_data_manager_impl.h" |
37 #include "content/browser/gpu/gpu_process_host.h" | 37 #include "content/browser/gpu/gpu_process_host.h" |
38 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 38 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
39 #include "content/browser/histogram_synchronizer.h" | 39 #include "content/browser/histogram_synchronizer.h" |
40 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 40 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
41 #include "content/browser/media/media_internals.h" | 41 #include "content/browser/media/media_internals.h" |
| 42 #include "content/browser/mojo/mojo_shell_context.h" |
42 #include "content/browser/net/browser_online_state_observer.h" | 43 #include "content/browser/net/browser_online_state_observer.h" |
43 #include "content/browser/renderer_host/media/media_stream_manager.h" | 44 #include "content/browser/renderer_host/media/media_stream_manager.h" |
44 #include "content/browser/speech/speech_recognition_manager_impl.h" | 45 #include "content/browser/speech/speech_recognition_manager_impl.h" |
45 #include "content/browser/startup_task_runner.h" | 46 #include "content/browser/startup_task_runner.h" |
46 #include "content/browser/time_zone_monitor.h" | 47 #include "content/browser/time_zone_monitor.h" |
47 #include "content/browser/webui/content_web_ui_controller_factory.h" | 48 #include "content/browser/webui/content_web_ui_controller_factory.h" |
48 #include "content/browser/webui/url_data_manager.h" | 49 #include "content/browser/webui/url_data_manager.h" |
49 #include "content/common/content_switches_internal.h" | 50 #include "content/common/content_switches_internal.h" |
50 #include "content/common/host_discardable_shared_memory_manager.h" | 51 #include "content/common/host_discardable_shared_memory_manager.h" |
51 #include "content/common/host_shared_bitmap_manager.h" | 52 #include "content/common/host_shared_bitmap_manager.h" |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp"); | 891 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp"); |
891 | 892 |
892 // Teardown may start in PostMainMessageLoopRun, and during teardown we | 893 // Teardown may start in PostMainMessageLoopRun, and during teardown we |
893 // need to be able to perform IO. | 894 // need to be able to perform IO. |
894 base::ThreadRestrictions::SetIOAllowed(true); | 895 base::ThreadRestrictions::SetIOAllowed(true); |
895 BrowserThread::PostTask( | 896 BrowserThread::PostTask( |
896 BrowserThread::IO, FROM_HERE, | 897 BrowserThread::IO, FROM_HERE, |
897 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), | 898 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), |
898 true)); | 899 true)); |
899 | 900 |
| 901 mojo_shell_context_.reset(); |
| 902 |
900 #if !defined(OS_IOS) | 903 #if !defined(OS_IOS) |
901 if (RenderProcessHost::run_renderer_in_process()) | 904 if (RenderProcessHost::run_renderer_in_process()) |
902 RenderProcessHostImpl::ShutDownInProcessRenderer(); | 905 RenderProcessHostImpl::ShutDownInProcessRenderer(); |
903 #endif | 906 #endif |
904 | 907 |
905 if (parts_) { | 908 if (parts_) { |
906 TRACE_EVENT0("shutdown", | 909 TRACE_EVENT0("shutdown", |
907 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); | 910 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); |
908 parts_->PostMainMessageLoopRun(); | 911 parts_->PostMainMessageLoopRun(); |
909 } | 912 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys(); | 1249 SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys(); |
1247 if (ShouldEnableBootstrapSandbox()) { | 1250 if (ShouldEnableBootstrapSandbox()) { |
1248 TRACE_EVENT0("startup", | 1251 TRACE_EVENT0("startup", |
1249 "BrowserMainLoop::BrowserThreadsStarted:BootstrapSandbox"); | 1252 "BrowserMainLoop::BrowserThreadsStarted:BootstrapSandbox"); |
1250 CHECK(GetBootstrapSandbox()); | 1253 CHECK(GetBootstrapSandbox()); |
1251 } | 1254 } |
1252 #endif // defined(OS_MACOSX) | 1255 #endif // defined(OS_MACOSX) |
1253 | 1256 |
1254 #endif // !defined(OS_IOS) | 1257 #endif // !defined(OS_IOS) |
1255 | 1258 |
| 1259 mojo_shell_context_.reset(new MojoShellContext); |
| 1260 |
1256 return result_code_; | 1261 return result_code_; |
1257 } | 1262 } |
1258 | 1263 |
1259 bool BrowserMainLoop::UsingInProcessGpu() const { | 1264 bool BrowserMainLoop::UsingInProcessGpu() const { |
1260 return parsed_command_line_.HasSwitch(switches::kSingleProcess) || | 1265 return parsed_command_line_.HasSwitch(switches::kSingleProcess) || |
1261 parsed_command_line_.HasSwitch(switches::kInProcessGPU); | 1266 parsed_command_line_.HasSwitch(switches::kInProcessGPU); |
1262 } | 1267 } |
1263 | 1268 |
1264 bool BrowserMainLoop::InitializeToolkit() { | 1269 bool BrowserMainLoop::InitializeToolkit() { |
1265 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); | 1270 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 DCHECK(is_tracing_startup_); | 1367 DCHECK(is_tracing_startup_); |
1363 | 1368 |
1364 is_tracing_startup_ = false; | 1369 is_tracing_startup_ = false; |
1365 TracingController::GetInstance()->DisableRecording( | 1370 TracingController::GetInstance()->DisableRecording( |
1366 TracingController::CreateFileSink( | 1371 TracingController::CreateFileSink( |
1367 startup_trace_file_, | 1372 startup_trace_file_, |
1368 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1373 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1369 } | 1374 } |
1370 | 1375 |
1371 } // namespace content | 1376 } // namespace content |
OLD | NEW |