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

Unified Diff: base/trace_event/memory_dump_manager.h

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 side-by-side diff with in-line comments
Download patch
Index: base/trace_event/memory_dump_manager.h
diff --git a/base/trace_event/memory_dump_manager.h b/base/trace_event/memory_dump_manager.h
index e34bdb0853cc6200d3a494969fe8582eb2040f79..60aeab98ee6a1111875a110b43e319d9c2eeabbb 100644
--- a/base/trace_event/memory_dump_manager.h
+++ b/base/trace_event/memory_dump_manager.h
@@ -36,6 +36,7 @@ class MemoryDumpSessionState;
// RequestDumpPoint(). The extension by Un(RegisterDumpProvider).
class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
public:
+ static const int kInvalidTracingProcessId = -1;
static const char* const kTraceCategoryForTesting;
static MemoryDumpManager* GetInstance();
@@ -81,6 +82,20 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
return session_state_;
}
+ // Sets the unique hash value for identifying child process to create cross
Primiano Tucci (use gerrit) 2015/06/23 13:35:20 Don't expose the "hash" thing here. Just clarify t
ssid 2015/06/24 08:37:57 hm, base/ shouldn't really know about child proces
+ // process unique guids. Pass kInvalidTracingProcessId for invalidating the
+ // id.
+ void set_tracing_process_id(int id) {
Primiano Tucci (use gerrit) 2015/06/23 13:35:20 Can you make the setter private and use the "frien
ssid 2015/06/24 08:37:57 Done.
+ DCHECK(tracing_process_id_ == kInvalidTracingProcessId ||
+ id == kInvalidTracingProcessId);
+ tracing_process_id_ = id;
+ }
+
+ int tracing_process_id() {
Primiano Tucci (use gerrit) 2015/06/23 13:35:20 +const
ssid 2015/06/24 08:37:57 Done.
+ DCHECK_NE(tracing_process_id_, kInvalidTracingProcessId);
Primiano Tucci (use gerrit) 2015/06/23 13:35:20 add a comment saying that if you are requesting th
ssid 2015/06/24 08:37:57 Done.
+ return tracing_process_id_;
+ }
+
private:
// Descriptor struct used to hold information about registered MDPs. It is
// deliberately copyable, in order to allow to be used as hash_map value.
@@ -139,6 +154,10 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
// For time-triggered periodic dumps.
RepeatingTimer<MemoryDumpManager> periodic_dump_timer_;
+ // The unique id of the child process for tracing. The value is expected to
Primiano Tucci (use gerrit) 2015/06/23 13:35:20 Can you clarify that this is neither the PID nor t
+ // be valid only when tracing is enabled.
+ int tracing_process_id_;
+
// Skips the auto-registration of the core dumpers during Initialize().
bool skip_core_dumpers_auto_registration_for_testing_;
« no previous file with comments | « no previous file | base/trace_event/memory_dump_manager.cc » ('j') | content/browser/tracing/trace_message_filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698