Chromium Code Reviews| 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..ad07e5d5ed2fb7ad3e1b5996ada7b348971912e9 100644 |
| --- a/base/trace_event/memory_dump_manager.cc |
| +++ b/base/trace_event/memory_dump_manager.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/atomic_sequence_num.h" |
| #include "base/compiler_specific.h" |
| +#include "base/hash.h" |
| #include "base/thread_task_runner_handle.h" |
| #include "base/trace_event/memory_dump_provider.h" |
| #include "base/trace_event/memory_dump_session_state.h" |
| @@ -157,6 +158,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 +434,12 @@ void MemoryDumpManager::OnTraceLogDisabled() { |
| session_state_ = nullptr; |
| } |
| +// static |
| +int MemoryDumpManager::ChildProcessIdToTracingProcessId(int child_process_id) { |
| + return Hash(reinterpret_cast<const char*>(&child_process_id), |
|
dcheng
2015/06/24 20:34:06
What happens if this just happens to be -1?
ssid
2015/06/25 02:35:49
Please see ChildProcessHost::kInvalidUniqueID, and
dcheng
2015/06/25 02:45:39
I don't understand: how are you guaranteeing that
ssid
2015/06/25 04:04:09
I see what you mean now. Thanks I just realized I
|
| + sizeof(child_process_id)); |
| +} |
| + |
| MemoryDumpManager::MemoryDumpProviderInfo::MemoryDumpProviderInfo( |
| const scoped_refptr<SingleThreadTaskRunner>& task_runner) |
| : task_runner(task_runner), consecutive_failures(0), disabled(false) { |