Chromium Code Reviews| Index: content/browser/browser_main_loop.cc |
| diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
| index 211afb42d2b7de4b686664707ac02de8c7c74b34..8b93f80d777f877a79c4b7d65f468695b9c2d6ac 100644 |
| --- a/content/browser/browser_main_loop.cc |
| +++ b/content/browser/browser_main_loop.cc |
| @@ -103,6 +103,7 @@ |
| #include "net/socket/client_socket_factory.h" |
| #include "net/ssl/ssl_config_service.h" |
| #include "ppapi/features/features.h" |
| +#include "services/resource_coordinator/memory/coordinator/coordinator_impl.h" |
| #include "services/service_manager/runner/common/client_util.h" |
| #include "skia/ext/event_tracer_impl.h" |
| #include "skia/ext/skia_memory_dump_provider.h" |
| @@ -579,6 +580,16 @@ void BrowserMainLoop::Init() { |
| GetContentClient()->browser()->CreateBrowserMainParts(parameters_)); |
| } |
| +// BrowserMainLoop static getters ========================================= |
| + |
| +// static |
| +memory_instrumentation::CoordinatorImpl* |
| +BrowserMainLoop::GetMemoryInstrumentationCoordinator() { |
| + if (g_current_browser_main_loop) |
| + return g_current_browser_main_loop->memory_instrumentation_coordinator(); |
| + return nullptr; |
| +} |
| + |
| // BrowserMainLoop stages ================================================== |
| void BrowserMainLoop::EarlyInitialization() { |
| @@ -827,6 +838,13 @@ void BrowserMainLoop::PostMainMessageLoopStart() { |
| LevelDBWrapperImpl::EnableAggressiveCommitDelay(); |
| } |
| + // Create the memory instrumentation service. It will initialize the memory |
| + // dump manager, too. It makes sense that BrowserMainLoop owns the service; |
| + // this way, the service is alive for the lifetime of Mojo. Mojo is shutdown |
| + // in BrowserMainLoop::ShutdownThreadsAndCleanupIO. |
| + memory_instrumentation_coordinator_ = |
| + base::MakeUnique<memory_instrumentation::CoordinatorImpl>(true); |
|
Primiano Tucci (use gerrit)
2017/03/13 21:31:10
maybe add a comment to: true /* is_coordinator*/
chiniforooshan
2017/03/14 16:06:36
Done.
|
| + |
| // Enable memory-infra dump providers. |
| InitSkiaEventTracer(); |
| tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess( |