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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 1173263004: [tracing] Send unique tracing process id for cross-process memory dumps identification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding comments. Created 5 years, 6 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: base/trace_event/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index 3814c21fd28698babd28008c41ca85283b3e817f..a184cdcb77836fd17c8306d0deb1235e4a262b9e 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -157,6 +157,7 @@ void MemoryDumpManager::SetInstanceForTesting(MemoryDumpManager* instance) {
MemoryDumpManager::MemoryDumpManager()
: delegate_(nullptr),
memory_tracing_enabled_(0),
+ tracing_process_id_(kInvalidTracingProcessId),
skip_core_dumpers_auto_registration_for_testing_(false) {
g_next_guid.GetNext(); // Make sure that first guid is not zero.
}
@@ -432,6 +433,11 @@ void MemoryDumpManager::OnTraceLogDisabled() {
session_state_ = nullptr;
}
+// static
+int MemoryDumpManager::ChildProcessIdToTracingProcessId(int child_process_id) {
+ return 1000 + child_process_id;
picksi 2015/06/24 11:12:43 Can we use a named const to explain the 1000, e.g.
jam 2015/06/24 16:38:15 why is this guessable? i.e. why not a hash?
Primiano Tucci (use gerrit) 2015/06/24 17:47:34 +1
+}
+
MemoryDumpManager::MemoryDumpProviderInfo::MemoryDumpProviderInfo(
const scoped_refptr<SingleThreadTaskRunner>& task_runner)
: task_runner(task_runner), consecutive_failures(0), disabled(false) {

Powered by Google App Engine
This is Rietveld 408576698