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

Side by Side 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: Nits. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/trace_event/memory_dump_manager.h" 5 #include "base/trace_event/memory_dump_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // static 167 // static
168 void MemoryDumpManager::SetInstanceForTesting(MemoryDumpManager* instance) { 168 void MemoryDumpManager::SetInstanceForTesting(MemoryDumpManager* instance) {
169 if (instance) 169 if (instance)
170 instance->skip_core_dumpers_auto_registration_for_testing_ = true; 170 instance->skip_core_dumpers_auto_registration_for_testing_ = true;
171 g_instance_for_testing = instance; 171 g_instance_for_testing = instance;
172 } 172 }
173 173
174 MemoryDumpManager::MemoryDumpManager() 174 MemoryDumpManager::MemoryDumpManager()
175 : delegate_(nullptr), 175 : delegate_(nullptr),
176 memory_tracing_enabled_(0), 176 memory_tracing_enabled_(0),
177 tracing_process_id_(kInvalidTracingProcessId),
177 skip_core_dumpers_auto_registration_for_testing_(false) { 178 skip_core_dumpers_auto_registration_for_testing_(false) {
178 g_next_guid.GetNext(); // Make sure that first guid is not zero. 179 g_next_guid.GetNext(); // Make sure that first guid is not zero.
179 } 180 }
180 181
181 MemoryDumpManager::~MemoryDumpManager() { 182 MemoryDumpManager::~MemoryDumpManager() {
182 base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver(this); 183 base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver(this);
183 } 184 }
184 185
185 void MemoryDumpManager::Initialize() { 186 void MemoryDumpManager::Initialize() {
186 TRACE_EVENT0(kTraceCategory, "init"); // Add to trace-viewer category list. 187 TRACE_EVENT0(kTraceCategory, "init"); // Add to trace-viewer category list.
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 452
452 MemoryDumpManager::MemoryDumpProviderInfo::MemoryDumpProviderInfo( 453 MemoryDumpManager::MemoryDumpProviderInfo::MemoryDumpProviderInfo(
453 const scoped_refptr<SingleThreadTaskRunner>& task_runner) 454 const scoped_refptr<SingleThreadTaskRunner>& task_runner)
454 : task_runner(task_runner), consecutive_failures(0), disabled(false) { 455 : task_runner(task_runner), consecutive_failures(0), disabled(false) {
455 } 456 }
456 MemoryDumpManager::MemoryDumpProviderInfo::~MemoryDumpProviderInfo() { 457 MemoryDumpManager::MemoryDumpProviderInfo::~MemoryDumpProviderInfo() {
457 } 458 }
458 459
459 } // namespace trace_event 460 } // namespace trace_event
460 } // namespace base 461 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698