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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/thread_task_runner_handle.h" | 21 #include "base/thread_task_runner_handle.h" |
22 #include "base/threading/thread_restrictions.h" | 22 #include "base/threading/thread_restrictions.h" |
23 #include "base/timer/hi_res_timer_manager.h" | 23 #include "base/timer/hi_res_timer_manager.h" |
24 #include "base/trace_event/memory_dump_manager.h" | 24 #include "base/trace_event/memory_dump_manager.h" |
25 #include "base/trace_event/trace_event.h" | 25 #include "base/trace_event/trace_event.h" |
26 #include "content/browser/browser_thread_impl.h" | 26 #include "content/browser/browser_thread_impl.h" |
27 #include "content/browser/device_sensors/device_inertial_sensor_service.h" | 27 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
28 #include "content/browser/download/save_file_manager.h" | 28 #include "content/browser/download/save_file_manager.h" |
29 #include "content/browser/gamepad/gamepad_service.h" | 29 #include "content/browser/gamepad/gamepad_service.h" |
30 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 30 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 31 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
31 #include "content/browser/gpu/compositor_util.h" | 32 #include "content/browser/gpu/compositor_util.h" |
32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 33 #include "content/browser/gpu/gpu_data_manager_impl.h" |
33 #include "content/browser/gpu/gpu_process_host.h" | 34 #include "content/browser/gpu/gpu_process_host.h" |
34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 35 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
35 #include "content/browser/histogram_synchronizer.h" | 36 #include "content/browser/histogram_synchronizer.h" |
36 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 37 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
37 #include "content/browser/media/media_internals.h" | 38 #include "content/browser/media/media_internals.h" |
38 #include "content/browser/net/browser_online_state_observer.h" | 39 #include "content/browser/net/browser_online_state_observer.h" |
39 #include "content/browser/renderer_host/media/media_stream_manager.h" | 40 #include "content/browser/renderer_host/media/media_stream_manager.h" |
40 #include "content/browser/speech/speech_recognition_manager_impl.h" | 41 #include "content/browser/speech/speech_recognition_manager_impl.h" |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 | 1075 |
1075 bool always_uses_gpu = true; | 1076 bool always_uses_gpu = true; |
1076 bool established_gpu_channel = false; | 1077 bool established_gpu_channel = false; |
1077 #if defined(USE_AURA) || defined(OS_MACOSX) | 1078 #if defined(USE_AURA) || defined(OS_MACOSX) |
1078 established_gpu_channel = true; | 1079 established_gpu_channel = true; |
1079 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || | 1080 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || |
1080 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit)) { | 1081 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit)) { |
1081 established_gpu_channel = always_uses_gpu = false; | 1082 established_gpu_channel = always_uses_gpu = false; |
1082 } | 1083 } |
1083 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1084 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
| 1085 // Register GpuMemoryBuffer dump provider with IO thread affinity. Note that |
| 1086 // unregistration happens on the IO thread (See |
| 1087 // BrowserProcessSubThread::IOThreadPreCleanUp). |
| 1088 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 1089 BrowserGpuMemoryBufferManager::current(), io_thread_->task_runner()); |
1084 ImageTransportFactory::Initialize(); | 1090 ImageTransportFactory::Initialize(); |
1085 #if defined(USE_AURA) | 1091 #if defined(USE_AURA) |
1086 if (aura::Env::GetInstance()) { | 1092 if (aura::Env::GetInstance()) { |
1087 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); | 1093 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); |
1088 } | 1094 } |
1089 #endif | 1095 #endif |
1090 #elif defined(OS_ANDROID) | 1096 #elif defined(OS_ANDROID) |
1091 // TODO(crbug.com/439322): This should be set to |true|. | 1097 // TODO(crbug.com/439322): This should be set to |true|. |
1092 established_gpu_channel = false; | 1098 established_gpu_channel = false; |
1093 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1099 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 | 1301 |
1296 void BrowserMainLoop::EndStartupTracing() { | 1302 void BrowserMainLoop::EndStartupTracing() { |
1297 is_tracing_startup_ = false; | 1303 is_tracing_startup_ = false; |
1298 TracingController::GetInstance()->DisableRecording( | 1304 TracingController::GetInstance()->DisableRecording( |
1299 TracingController::CreateFileSink( | 1305 TracingController::CreateFileSink( |
1300 startup_trace_file_, | 1306 startup_trace_file_, |
1301 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1307 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1302 } | 1308 } |
1303 | 1309 |
1304 } // namespace content | 1310 } // namespace content |
OLD | NEW |