summaryrefslogtreecommitdiffstats
path: root/base/test/trace_event_analyzer.h
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-13 03:12:44 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-13 03:12:44 +0000
commit761550737a7bd68856f2a28fe389b23d135ddcc2 (patch)
tree2ee375731da5c2cb4681a04c096f3b34a0f51146 /base/test/trace_event_analyzer.h
parent19f9f17b1b18771f39d36087bf24bec8cd3bf98c (diff)
downloadchromium_src-761550737a7bd68856f2a28fe389b23d135ddcc2.zip
chromium_src-761550737a7bd68856f2a28fe389b23d135ddcc2.tar.gz
chromium_src-761550737a7bd68856f2a28fe389b23d135ddcc2.tar.bz2
Allow tracing in third_party libraries
This is step 1 -- refactor the code to allow us to split up trace_event.h into trace_event.h and trace_event_export.h/cc. Step 2 is to cut out trace_event_export.h/cc. The _export.h/cc will be laid out so they can be copied to other third_party libraries and then tweaked to call through to chromium's internal tracing API via platform APIs or function pointers. To make these APIs easily exportable, this change primarily aims to eliminate the custom objects (ie: TraceValue) and types that will cause problems when defined in multiple libraries. The macros and internal namespace are destined for trace_event_export.h/cc in a future CL. BUG=109779 Review URL: http://codereview.chromium.org/9155024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117598 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test/trace_event_analyzer.h')
-rw-r--r--base/test/trace_event_analyzer.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/base/test/trace_event_analyzer.h b/base/test/trace_event_analyzer.h
index 949721b..4817ec8 100644
--- a/base/test/trace_event_analyzer.h
+++ b/base/test/trace_event_analyzer.h
@@ -152,7 +152,7 @@ struct TraceEvent {
// Stored as double to match its JSON representation.
double timestamp;
- base::debug::TraceEventPhase phase;
+ char phase;
std::string category;
@@ -193,7 +193,7 @@ class Query {
static Query Bool(bool boolean);
// Compare with the given phase.
- static Query Phase(base::debug::TraceEventPhase phase);
+ static Query Phase(char phase);
// Compare with the given string pattern. Only works with == and != operators.
// Example: Query(EVENT_NAME) == Query::Pattern("MyEvent*")
@@ -424,10 +424,11 @@ class Query {
bool EvaluateArithmeticOperator(const TraceEvent& event,
double* num) const;
- // For QUERY_EVENT_MEMBER Query: attempt to get the value of the Query.
- // The TraceValue will either be TRACE_TYPE_DOUBLE, TRACE_TYPE_STRING,
- // or if requested member does not exist, it will be TRACE_TYPE_UNDEFINED.
- base::debug::TraceValue GetMemberValue(const TraceEvent& event) const;
+ // For QUERY_EVENT_MEMBER Query: attempt to get the double value of the Query.
+ bool GetMemberValueAsDouble(const TraceEvent& event, double* num) const;
+
+ // For QUERY_EVENT_MEMBER Query: attempt to get the string value of the Query.
+ bool GetMemberValueAsString(const TraceEvent& event, std::string* num) const;
// Does this Query represent a value?
bool is_value() const { return type_ != QUERY_BOOLEAN_OPERATOR; }