Chromium Code Reviews| Index: base/trace_event/trace_event_impl.h |
| diff --git a/base/trace_event/trace_event_impl.h b/base/trace_event/trace_event_impl.h |
| index 33a85c9b6ce854f4e6b6cde748fe6abca8a015d2..30b2a63df2ddfe732a0f3930e81a033143428d50 100644 |
| --- a/base/trace_event/trace_event_impl.h |
| +++ b/base/trace_event/trace_event_impl.h |
| @@ -122,7 +122,10 @@ class BASE_EXPORT TraceEvent { |
| void UpdateDuration(const TimeTicks& now, const TimeTicks& thread_now); |
| // Serialize event data to JSON |
| - void AppendAsJSON(std::string* out) const; |
| + typedef base::Callback<bool(const char* category_group_name, |
| + const char* event_name)> EventFilterPredicate; |
| + void AppendAsJSON(std::string* out, |
| + const EventFilterPredicate& event_filter_predicate) const; |
| void AppendPrettyPrinted(std::ostringstream* out) const; |
| static void AppendValueAsJSON(unsigned char type, |
| @@ -383,12 +386,14 @@ struct BASE_EXPORT TraceOptions { |
| TraceOptions() |
| : record_mode(RECORD_UNTIL_FULL), |
| enable_sampling(false), |
| - enable_systrace(false) {} |
| + enable_systrace(false), |
| + enable_args_whitelist(false) {} |
| explicit TraceOptions(TraceRecordMode record_mode) |
| : record_mode(record_mode), |
| enable_sampling(false), |
| - enable_systrace(false) {} |
| + enable_systrace(false), |
| + enable_args_whitelist(false) {} |
|
nduca
2015/05/01 03:09:03
Should devtools protocol support this enable_args_
|
| // |options_string| is a comma-delimited list of trace options. |
| // Possible options are: "record-until-full", "record-continuously", |
| @@ -419,6 +424,7 @@ struct BASE_EXPORT TraceOptions { |
| TraceRecordMode record_mode; |
| bool enable_sampling; |
| bool enable_systrace; |
| + bool enable_args_whitelist; |
| }; |
| struct BASE_EXPORT TraceLogStatus { |
| @@ -532,6 +538,8 @@ class BASE_EXPORT TraceLog { |
| void SetEventCallbackEnabled(const CategoryFilter& category_filter, |
| EventCallback cb); |
| void SetEventCallbackDisabled(); |
| + void SetEventFilterPredicate( |
| + const TraceEvent::EventFilterPredicate& event_filter_predicate); |
| // Flush all collected events to the given output callback. The callback will |
| // be called one or more times either synchronously or asynchronously from |
| @@ -717,9 +725,10 @@ class BASE_EXPORT TraceLog { |
| // is called for the flush of the current |logged_events_|. |
| void FlushCurrentThread(int generation); |
| // Usually it runs on a different thread. |
| - static void ConvertTraceEventsToTraceFormat( |
| + void ConvertTraceEventsToTraceFormat( |
| scoped_ptr<TraceBuffer> logged_events, |
| - const TraceLog::OutputCallback& flush_output_callback); |
| + const TraceLog::OutputCallback& flush_output_callback, |
| + const TraceEvent::EventFilterPredicate& event_filter_predicate); |
| void FinishFlush(int generation); |
| void OnFlushTimeout(int generation); |
| @@ -746,6 +755,7 @@ class BASE_EXPORT TraceLog { |
| static const InternalTraceOptions kInternalEchoToConsole; |
| static const InternalTraceOptions kInternalEnableSampling; |
| static const InternalTraceOptions kInternalRecordAsMuchAsPossible; |
| + static const InternalTraceOptions kInternalEnableArgsWhitelist; |
| // This lock protects TraceLog member accesses (except for members protected |
| // by thread_info_lock_) from arbitrary threads. |
| @@ -809,6 +819,7 @@ class BASE_EXPORT TraceLog { |
| // Set when asynchronous Flush is in progress. |
| OutputCallback flush_output_callback_; |
| + TraceEvent::EventFilterPredicate event_filter_predicate_; |
| scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; |
| subtle::AtomicWord generation_; |
| bool use_worker_thread_; |