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

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: Split into BlameContext and TracedBlameContext. 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..5ca7b0521a99c400d67a9fbb0ee13794d112e49c 100644
--- a/base/test/trace_event_analyzer.h
+++ b/base/test/trace_event_analyzer.h
@@ -120,6 +120,8 @@ struct TraceEvent {
return timestamp < rhs.timestamp;
}
+ void operator=(const TraceEvent& rhs);
danakj 2016/03/16 18:29:49 TraceEvent is pretty heavy. Does it need to be cop
Sami 2016/03/17 12:27:13 It's kept around in stl containers so it needs to
danakj 2016/03/18 21:22:22 STL containers don't need to copy anymore with C++
+
bool has_other_event() const { return other_event; }
// Returns absolute duration in microseconds between this event and other
@@ -131,11 +133,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 +151,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;
@@ -168,6 +176,8 @@ struct TraceEvent {
std::map<std::string, std::string> arg_strings;
+ std::map<std::string, scoped_ptr<base::Value>> arg_values;
+
danakj 2016/03/16 18:29:49 The amount of whitespace in this class is
Sami 2016/03/17 12:27:13 Now that you mention it I think I'll just compact
// The other event associated with this event (or NULL).
const TraceEvent* other_event;
};

Powered by Google App Engine
This is Rietveld 408576698