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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 if (aura::Env::GetInstance()) { | 1087 if (aura::Env::GetInstance()) { |
1087 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); | 1088 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); |
1088 } | 1089 } |
1089 #endif | 1090 #endif |
1090 #elif defined(OS_ANDROID) | 1091 #elif defined(OS_ANDROID) |
1091 // TODO(crbug.com/439322): This should be set to |true|. | 1092 // TODO(crbug.com/439322): This should be set to |true|. |
1092 established_gpu_channel = false; | 1093 established_gpu_channel = false; |
1093 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1094 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
1094 #endif | 1095 #endif |
1095 | 1096 |
| 1097 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that |
| 1098 // unregistration happens on the IO thread (See |
| 1099 // BrowserProcessSubThread::IOThreadPreCleanUp). |
| 1100 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 1101 BrowserGpuMemoryBufferManager::current(), io_thread_->task_runner()); |
| 1102 |
1096 { | 1103 { |
1097 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); | 1104 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); |
1098 audio_manager_.reset(media::AudioManager::CreateWithHangTimer( | 1105 audio_manager_.reset(media::AudioManager::CreateWithHangTimer( |
1099 MediaInternals::GetInstance(), io_thread_->task_runner())); | 1106 MediaInternals::GetInstance(), io_thread_->task_runner())); |
1100 } | 1107 } |
1101 | 1108 |
1102 { | 1109 { |
1103 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:MidiManager"); | 1110 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:MidiManager"); |
1104 midi_manager_.reset(media::MidiManager::Create()); | 1111 midi_manager_.reset(media::MidiManager::Create()); |
1105 } | 1112 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 | 1302 |
1296 void BrowserMainLoop::EndStartupTracing() { | 1303 void BrowserMainLoop::EndStartupTracing() { |
1297 is_tracing_startup_ = false; | 1304 is_tracing_startup_ = false; |
1298 TracingController::GetInstance()->DisableRecording( | 1305 TracingController::GetInstance()->DisableRecording( |
1299 TracingController::CreateFileSink( | 1306 TracingController::CreateFileSink( |
1300 startup_trace_file_, | 1307 startup_trace_file_, |
1301 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1308 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1302 } | 1309 } |
1303 | 1310 |
1304 } // namespace content | 1311 } // namespace content |
OLD | NEW |