Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2173)

Unified Diff: components/tracing/child_memory_dump_manager_delegate_impl.cc

Issue 1417003003: [tracing] Dump child processes' memory metrics in browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: Fixes. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/tracing/child_memory_dump_manager_delegate_impl.cc
diff --git a/components/tracing/child_memory_dump_manager_delegate_impl.cc b/components/tracing/child_memory_dump_manager_delegate_impl.cc
index 05c2662786ba5017e1bee7400b82f98f4fa613db..ced940b2295c506bc1ffe376e96d343627d3e647 100644
--- a/components/tracing/child_memory_dump_manager_delegate_impl.cc
+++ b/components/tracing/child_memory_dump_manager_delegate_impl.cc
@@ -5,7 +5,9 @@
#include "components/tracing/child_memory_dump_manager_delegate_impl.h"
#include "base/single_thread_task_runner.h"
+#include "build/build_config.h"
#include "components/tracing/child_trace_message_filter.h"
+#include "components/tracing/process_metrics_memory_dump_provider.h"
namespace tracing {
@@ -49,6 +51,13 @@ void ChildMemoryDumpManagerDelegateImpl::SetChildTraceMessageFilter(
if (ctmf) {
base::trace_event::MemoryDumpManager::GetInstance()->Initialize(
this /* delegate */, false /* is_coordinator */);
+
+#if !defined(OS_LINUX) && !defined(OS_NACL)
+ // On linux the browser process takes care of dumping process metrics.
+ // The child process is not allowed to do so due to BPF sandbox.
+ tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess(
+ base::kNullProcessId);
+#endif
}
}

Powered by Google App Engine
This is Rietveld 408576698