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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 } | 790 } |
791 | 791 |
792 if (parsed_command_line_.HasSwitch( | 792 if (parsed_command_line_.HasSwitch( |
793 switches::kEnableAggressiveDOMStorageFlushing)) { | 793 switches::kEnableAggressiveDOMStorageFlushing)) { |
794 TRACE_EVENT0("startup", | 794 TRACE_EVENT0("startup", |
795 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); | 795 "BrowserMainLoop::Subsystem:EnableAggressiveCommitDelay"); |
796 DOMStorageArea::EnableAggressiveCommitDelay(); | 796 DOMStorageArea::EnableAggressiveCommitDelay(); |
797 LevelDBWrapperImpl::EnableAggressiveCommitDelay(); | 797 LevelDBWrapperImpl::EnableAggressiveCommitDelay(); |
798 } | 798 } |
799 | 799 |
800 // Create the memory instrumentation service. It will initialize the memory | |
801 // dump manager, too. It makes sense that BrowserMainLoop owns the service; | |
802 // this way, the service is alive for the lifetime of Mojo. Mojo is shutdown | |
803 // in BrowserMainLoop::ShutdownThreadsAndCleanupIO. | |
804 memory_instrumentation_coordinator_ = | |
805 base::MakeUnique<memory_instrumentation::CoordinatorImpl>( | |
806 true /* initialize_memory_dump_manager */); | |
807 | |
808 // Enable memory-infra dump providers. | 800 // Enable memory-infra dump providers. |
809 InitSkiaEventTracer(); | 801 InitSkiaEventTracer(); |
810 tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess( | 802 tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess( |
811 base::kNullProcessId); | 803 base::kNullProcessId); |
812 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 804 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
813 display_compositor::HostSharedBitmapManager::current(), | 805 display_compositor::HostSharedBitmapManager::current(), |
814 "display_compositor::HostSharedBitmapManager", nullptr); | 806 "display_compositor::HostSharedBitmapManager", nullptr); |
815 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 807 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
816 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); | 808 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); |
817 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 809 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 } | 1384 } |
1393 | 1385 |
1394 int BrowserMainLoop::BrowserThreadsStarted() { | 1386 int BrowserMainLoop::BrowserThreadsStarted() { |
1395 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); | 1387 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); |
1396 | 1388 |
1397 // Bring up Mojo IPC and the embedded Service Manager as early as possible. | 1389 // Bring up Mojo IPC and the embedded Service Manager as early as possible. |
1398 // Initializaing mojo requires the IO thread to have been initialized first, | 1390 // Initializaing mojo requires the IO thread to have been initialized first, |
1399 // so this cannot happen any earlier than now. | 1391 // so this cannot happen any earlier than now. |
1400 InitializeMojo(); | 1392 InitializeMojo(); |
1401 | 1393 |
| 1394 // Create the memory instrumentation service. It will initialize the memory |
| 1395 // dump manager, too. It makes sense that BrowserMainLoop owns the service; |
| 1396 // this way, the service is alive for the lifetime of Mojo. Mojo is shutdown |
| 1397 // in BrowserMainLoop::ShutdownThreadsAndCleanupIO. |
| 1398 memory_instrumentation_coordinator_ = |
| 1399 base::MakeUnique<memory_instrumentation::CoordinatorImpl>( |
| 1400 true /* initialize_memory_dump_manager */, |
| 1401 content::ServiceManagerConnection::GetForProcess()->GetConnector()); |
| 1402 |
1402 #if defined(USE_AURA) | 1403 #if defined(USE_AURA) |
1403 if (service_manager::ServiceManagerIsRemote()) { | 1404 if (service_manager::ServiceManagerIsRemote()) { |
1404 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 1405 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
1405 switches::kIsRunningInMash); | 1406 switches::kIsRunningInMash); |
1406 } | 1407 } |
1407 #endif | 1408 #endif |
1408 | 1409 |
1409 indexed_db_thread_.reset(new base::Thread("IndexedDB")); | 1410 indexed_db_thread_.reset(new base::Thread("IndexedDB")); |
1410 indexed_db_thread_->Start(); | 1411 indexed_db_thread_->Start(); |
1411 | 1412 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1776 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
1776 MediaInternals::GetInstance()); | 1777 MediaInternals::GetInstance()); |
1777 } | 1778 } |
1778 CHECK(audio_manager_); | 1779 CHECK(audio_manager_); |
1779 | 1780 |
1780 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1781 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
1781 CHECK(audio_system_); | 1782 CHECK(audio_system_); |
1782 } | 1783 } |
1783 | 1784 |
1784 } // namespace content | 1785 } // namespace content |
OLD | NEW |