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

Unified Diff: content/browser/tracing/tracing_controller_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: primiano's comments Created 4 years, 12 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: content/browser/tracing/tracing_controller_impl.cc
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc
index 684bea8ec49b574b7ce45586d9aee86388c0e645..b2745d7feaaa5a7990799c3b517391170e2393b4 100644
--- a/content/browser/tracing/tracing_controller_impl.cc
+++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -12,6 +12,7 @@
#include "base/sys_info.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "components/tracing/process_metrics_memory_dump_provider.h"
#include "content/browser/tracing/file_tracing_provider_impl.h"
#include "content/browser/tracing/power_tracing_agent.h"
#include "content/browser/tracing/trace_message_filter.h"
@@ -556,6 +557,13 @@ void TracingControllerImpl::AddTraceMessageFilter(
return;
}
+#if defined(OS_LINUX)
+ // The browser process dumps process metrics for child process in linux due to
Primiano Tucci (use gerrit) 2016/01/05 11:55:17 nit: reword as: On Linux the browser....
ssid 2016/01/06 20:26:33 Done.
+ // sandbox.
+ tracing::ProcessMetricsMemoryDumpProvider::RegisterForProcess(
+ trace_message_filter->PeerHandle());
+#endif
+
trace_message_filters_.insert(trace_message_filter);
if (can_cancel_watch_event()) {
trace_message_filter->SendSetWatchEvent(watch_category_name_,
@@ -584,6 +592,11 @@ void TracingControllerImpl::RemoveTraceMessageFilter(
return;
}
+#if defined(OS_LINUX)
+ tracing::ProcessMetricsMemoryDumpProvider::UnregisterForProcess(
+ trace_message_filter->PeerHandle());
+#endif
+
// If a filter is removed while a response from that filter is pending then
// simulate the response. Otherwise the response count will be wrong and the
// completion callback will never be executed.

Powered by Google App Engine
This is Rietveld 408576698