| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 if (parsed_command_line_.HasSwitch( | 660 if (parsed_command_line_.HasSwitch( |
| 661 switches::kEnableAggressiveDOMStorageFlushing)) { | 661 switches::kEnableAggressiveDOMStorageFlushing)) { |
| 662 TRACE_EVENT0("startup", | 662 TRACE_EVENT0("startup", |
| 663 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); | 663 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); |
| 664 DOMStorageArea::EnableAggressiveCommitDelay(); | 664 DOMStorageArea::EnableAggressiveCommitDelay(); |
| 665 } | 665 } |
| 666 | 666 |
| 667 // Enable memory-infra dump providers. | 667 // Enable memory-infra dump providers. |
| 668 InitSkiaEventTracer(); | 668 InitSkiaEventTracer(); |
| 669 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 669 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 670 HostSharedBitmapManager::current()); | 670 HostSharedBitmapManager::current(), "HostSharedBitmapManager"); |
| 671 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 671 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 672 skia::SkiaMemoryDumpProvider::GetInstance()); | 672 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia"); |
| 673 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 673 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 674 sql::SqlMemoryDumpProvider::GetInstance()); | 674 sql::SqlMemoryDumpProvider::GetInstance(), "Sql"); |
| 675 | 675 |
| 676 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 676 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 677 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( | 677 trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( |
| 678 base::MessageLoop::current()->task_runner(), | 678 base::MessageLoop::current()->task_runner(), |
| 679 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, | 679 ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, |
| 680 ::GetHeapProfile)); | 680 ::GetHeapProfile)); |
| 681 #endif | 681 #endif |
| 682 } | 682 } |
| 683 | 683 |
| 684 int BrowserMainLoop::PreCreateThreads() { | 684 int BrowserMainLoop::PreCreateThreads() { |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 if (aura::Env::GetInstance()) { | 1188 if (aura::Env::GetInstance()) { |
| 1189 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); | 1189 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); |
| 1190 } | 1190 } |
| 1191 #endif // defined(USE_AURA) | 1191 #endif // defined(USE_AURA) |
| 1192 #endif // defined(OS_ANDROID) | 1192 #endif // defined(OS_ANDROID) |
| 1193 | 1193 |
| 1194 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that | 1194 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that |
| 1195 // unregistration happens on the IO thread (See | 1195 // unregistration happens on the IO thread (See |
| 1196 // BrowserProcessSubThread::IOThreadPreCleanUp). | 1196 // BrowserProcessSubThread::IOThreadPreCleanUp). |
| 1197 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 1197 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 1198 BrowserGpuMemoryBufferManager::current(), io_thread_->task_runner()); | 1198 BrowserGpuMemoryBufferManager::current(), "BrowserGpuMemoryBufferManager", |
| 1199 io_thread_->task_runner()); |
| 1199 #if defined(OS_ANDROID) | 1200 #if defined(OS_ANDROID) |
| 1200 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 1201 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 1201 tracing::GraphicsMemoryDumpProvider::GetInstance()); | 1202 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics"); |
| 1202 #endif | 1203 #endif |
| 1203 | 1204 |
| 1204 { | 1205 { |
| 1205 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); | 1206 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); |
| 1206 audio_manager_.reset(media::AudioManager::CreateWithHangTimer( | 1207 audio_manager_.reset(media::AudioManager::CreateWithHangTimer( |
| 1207 MediaInternals::GetInstance(), io_thread_->task_runner())); | 1208 MediaInternals::GetInstance(), io_thread_->task_runner())); |
| 1208 } | 1209 } |
| 1209 | 1210 |
| 1210 { | 1211 { |
| 1211 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:MidiManager"); | 1212 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:MidiManager"); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 DCHECK(is_tracing_startup_for_duration_); | 1423 DCHECK(is_tracing_startup_for_duration_); |
| 1423 | 1424 |
| 1424 is_tracing_startup_for_duration_ = false; | 1425 is_tracing_startup_for_duration_ = false; |
| 1425 TracingController::GetInstance()->DisableRecording( | 1426 TracingController::GetInstance()->DisableRecording( |
| 1426 TracingController::CreateFileSink( | 1427 TracingController::CreateFileSink( |
| 1427 startup_trace_file_, | 1428 startup_trace_file_, |
| 1428 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1429 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1429 } | 1430 } |
| 1430 | 1431 |
| 1431 } // namespace content | 1432 } // namespace content |
| OLD | NEW |