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

Unified Diff: base/debug/activity_tracker.cc

Issue 2583223002: Collect stability data from global and activity scopes (Closed)
Patch Set: Merge Created 3 years, 11 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.cc
diff --git a/base/debug/activity_tracker.cc b/base/debug/activity_tracker.cc
index 562e662c98972f0588ba3ee9266b73c813b8e620..f12d1057a5a4462ee2086a23be8e7f284c4f3b2c 100644
--- a/base/debug/activity_tracker.cc
+++ b/base/debug/activity_tracker.cc
@@ -5,6 +5,8 @@
#include "base/debug/activity_tracker.h"
#include <algorithm>
+#include <limits>
+#include <utility>
#include "base/debug/stack_trace.h"
#include "base/files/file.h"
@@ -12,7 +14,6 @@
#include "base/files/memory_mapped_file.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
-#include "base/memory/ptr_util.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/pending_task.h"
@@ -205,43 +206,43 @@ ActivityUserData::TypedValue::TypedValue(const TypedValue& other) = default;
ActivityUserData::TypedValue::~TypedValue() {}
StringPiece ActivityUserData::TypedValue::Get() const {
- DCHECK_EQ(RAW_VALUE, type);
- return long_value;
+ DCHECK_EQ(RAW_VALUE, type_);
+ return long_value_;
}
StringPiece ActivityUserData::TypedValue::GetString() const {
- DCHECK_EQ(STRING_VALUE, type);
- return long_value;
+ DCHECK_EQ(STRING_VALUE, type_);
+ return long_value_;
}
bool ActivityUserData::TypedValue::GetBool() const {
- DCHECK_EQ(BOOL_VALUE, type);
- return short_value != 0;
+ DCHECK_EQ(BOOL_VALUE, type_);
+ return short_value_ != 0;
}
char ActivityUserData::TypedValue::GetChar() const {
- DCHECK_EQ(CHAR_VALUE, type);
- return static_cast<char>(short_value);
+ DCHECK_EQ(CHAR_VALUE, type_);
+ return static_cast<char>(short_value_);
}
int64_t ActivityUserData::TypedValue::GetInt() const {
- DCHECK_EQ(SIGNED_VALUE, type);
- return static_cast<int64_t>(short_value);
+ DCHECK_EQ(SIGNED_VALUE, type_);
+ return static_cast<int64_t>(short_value_);
}
uint64_t ActivityUserData::TypedValue::GetUint() const {
- DCHECK_EQ(UNSIGNED_VALUE, type);
- return static_cast<uint64_t>(short_value);
+ DCHECK_EQ(UNSIGNED_VALUE, type_);
+ return static_cast<uint64_t>(short_value_);
}
StringPiece ActivityUserData::TypedValue::GetReference() const {
- DCHECK_EQ(RAW_VALUE_REFERENCE, type);
- return ref_value;
+ DCHECK_EQ(RAW_VALUE_REFERENCE, type_);
+ return ref_value_;
}
StringPiece ActivityUserData::TypedValue::GetStringReference() const {
- DCHECK_EQ(STRING_VALUE_REFERENCE, type);
- return ref_value;
+ DCHECK_EQ(STRING_VALUE_REFERENCE, type_);
+ return ref_value_;
}
ActivityUserData::ValueInfo::ValueInfo() {}
@@ -429,14 +430,14 @@ bool ActivityUserData::CreateSnapshot(Snapshot* output_snapshot) const {
for (const auto& entry : values_) {
TypedValue value;
- value.type = entry.second.type;
+ value.type_ = entry.second.type;
DCHECK_GE(entry.second.extent,
entry.second.size_ptr->load(std::memory_order_relaxed));
switch (entry.second.type) {
case RAW_VALUE:
case STRING_VALUE:
- value.long_value =
+ value.long_value_ =
std::string(reinterpret_cast<char*>(entry.second.memory),
entry.second.size_ptr->load(std::memory_order_relaxed));
break;
@@ -444,17 +445,17 @@ bool ActivityUserData::CreateSnapshot(Snapshot* output_snapshot) const {
case STRING_VALUE_REFERENCE: {
ReferenceRecord* ref =
reinterpret_cast<ReferenceRecord*>(entry.second.memory);
- value.ref_value = StringPiece(
+ value.ref_value_ = StringPiece(
reinterpret_cast<char*>(static_cast<uintptr_t>(ref->address)),
static_cast<size_t>(ref->size));
} break;
case BOOL_VALUE:
case CHAR_VALUE:
- value.short_value = *reinterpret_cast<char*>(entry.second.memory);
+ value.short_value_ = *reinterpret_cast<char*>(entry.second.memory);
break;
case SIGNED_VALUE:
case UNSIGNED_VALUE:
- value.short_value = *reinterpret_cast<uint64_t*>(entry.second.memory);
+ value.short_value_ = *reinterpret_cast<uint64_t*>(entry.second.memory);
break;
case END_OF_VALUES: // Included for completeness purposes.
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698