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

Unified Diff: base/debug/activity_tracker.h

Issue 2754483002: Add analyzer support for multiple processes. (Closed)
Patch Set: rebased Created 3 years, 9 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/debug/activity_tracker.h
diff --git a/base/debug/activity_tracker.h b/base/debug/activity_tracker.h
index 922528fb38702fdd023eeec906bba6fb8d7cb22c..05a034f0eb8d53a92e24309846779279f664bb24 100644
--- a/base/debug/activity_tracker.h
+++ b/base/debug/activity_tracker.h
@@ -377,7 +377,7 @@ class BASE_EXPORT ActivityUserData {
private:
friend class ActivityUserData;
- ValueType type_;
+ ValueType type_ = END_OF_VALUES;
uint64_t short_value_; // Used to hold copy of numbers, etc.
std::string long_value_; // Used to hold copy of raw/string data.
StringPiece ref_value_; // Used to hold reference to external data.
@@ -440,9 +440,9 @@ class BASE_EXPORT ActivityUserData {
// Creates a snapshot of the key/value pairs contained within. The returned
// data will be fixed, independent of whatever changes afterward. There is
- // protection against concurrent modification of the values but no protection
- // against a complete overwrite of the contents; the caller must ensure that
- // the memory segment is not going to be re-initialized while this runs.
+ // some protection against concurrent modification. This will return false
+ // if the data is invalid or if a complete overwrite of the contents is
+ // detected.
bool CreateSnapshot(Snapshot* output_snapshot) const;
// Gets the base memory address used for storing data.
@@ -531,6 +531,12 @@ class BASE_EXPORT ActivityUserData {
// A pointer to the memory header for this instance.
MemoryHeader* const header_;
+ // These hold values used when initially creating the object. They are
+ // compared against current header values to check for outside changes.
+ const uint32_t orig_data_id;
+ const int64_t orig_process_id;
+ const int64_t orig_create_stamp;
+
DISALLOW_COPY_AND_ASSIGN(ActivityUserData);
};
@@ -565,6 +571,9 @@ class BASE_EXPORT ThreadActivityTracker {
// truncated due to internal length limitations.
std::string thread_name;
+ // The timestamp at which this process was created.
+ int64_t create_stamp;
+
// The process and thread IDs. These values have no meaning other than
// they uniquely identify a running process and a running thread within
// that process. Thread-IDs can be re-used across different processes

Powered by Google App Engine
This is Rietveld 408576698