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

Unified Diff: base/test/trace_event_analyzer.h

Issue 1776673002: base: Add blame context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 4 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/test/trace_event_analyzer.h
diff --git a/base/test/trace_event_analyzer.h b/base/test/trace_event_analyzer.h
index 253dbb4d5bdb747d642b60cf503a97b0d7b57c42..9310407deeb6a05e48d0eeb37e716aac569eda7c 100644
--- a/base/test/trace_event_analyzer.h
+++ b/base/test/trace_event_analyzer.h
@@ -112,6 +112,7 @@ struct TraceEvent {
TraceEvent();
TraceEvent(const TraceEvent& other);
+ TraceEvent(TraceEvent&& other);
~TraceEvent();
bool SetFromJSON(const base::Value* event_value) WARN_UNUSED_RESULT;
@@ -120,6 +121,9 @@ struct TraceEvent {
return timestamp < rhs.timestamp;
}
+ TraceEvent& operator=(const TraceEvent& rhs);
+ TraceEvent& operator=(TraceEvent&& rhs);
+
bool has_other_event() const { return other_event; }
// Returns absolute duration in microseconds between this event and other
@@ -131,11 +135,16 @@ struct TraceEvent {
bool GetArgAsString(const std::string& name, std::string* arg) const;
// Return the argument value if it exists and it is a number.
bool GetArgAsNumber(const std::string& name, double* arg) const;
+ // Return the argument value if it exists.
+ bool GetArgAsValue(const std::string& name,
+ scoped_ptr<base::Value>* arg) const;
// Check if argument exists and is string.
bool HasStringArg(const std::string& name) const;
// Check if argument exists and is number (double, int or bool).
bool HasNumberArg(const std::string& name) const;
+ // Check if argument exists.
+ bool HasArg(const std::string& name) const;
// Get known existing arguments as specific types.
// Useful when you have already queried the argument with
@@ -144,6 +153,7 @@ struct TraceEvent {
double GetKnownArgAsDouble(const std::string& name) const;
int GetKnownArgAsInt(const std::string& name) const;
bool GetKnownArgAsBool(const std::string& name) const;
+ scoped_ptr<base::Value> GetKnownArgAsValue(const std::string& name) const;
// Process ID and Thread ID.
ProcessThreadID thread;
@@ -151,22 +161,17 @@ struct TraceEvent {
// Time since epoch in microseconds.
// Stored as double to match its JSON representation.
double timestamp;
-
double duration;
-
char phase;
-
std::string category;
-
std::string name;
-
std::string id;
// All numbers and bool values from TraceEvent args are cast to double.
// bool becomes 1.0 (true) or 0.0 (false).
std::map<std::string, double> arg_numbers;
-
std::map<std::string, std::string> arg_strings;
+ std::map<std::string, scoped_ptr<base::Value>> arg_values;
// The other event associated with this event (or NULL).
const TraceEvent* other_event;

Powered by Google App Engine
This is Rietveld 408576698