Index: base/debug/trace_event.h |
diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h |
index d5aa256dc15cb769c2de0a312eb5c2084f7f56ba..4048f73fd2d10114c613b87243c6787123e133ba 100644 |
--- a/base/debug/trace_event.h |
+++ b/base/debug/trace_event.h |
@@ -419,6 +419,10 @@ class BASE_EXPORT TraceValue { |
return value; |
} |
+ bool is_string() const { |
+ return type_ == TRACE_TYPE_STRING || type_ == TRACE_TYPE_STATIC_STRING; |
+ } |
+ |
void AppendAsJSON(std::string* out) const; |
Type type() const { |
@@ -445,7 +449,7 @@ class BASE_EXPORT TraceValue { |
return value_.as_pointer; |
} |
const char* as_string() const { |
- DCHECK(type_ == TRACE_TYPE_STRING || type_ == TRACE_TYPE_STATIC_STRING); |
+ DCHECK(is_string()); |
return value_.as_string; |
} |
const char** as_assignable_string() { |
@@ -485,6 +489,9 @@ class TraceEvent { |
bool copy); |
~TraceEvent(); |
+ static const char* GetPhaseStr(TraceEventPhase phase); |
+ static TraceEventPhase GetPhase(const char* phase); |
+ |
// Serialize event data to JSON |
static void AppendEventsAsJSON(const std::vector<TraceEvent>& events, |
size_t start, |