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

Unified Diff: components/tracing/child/child_trace_message_filter.cc

Issue 2466873002: Enable FILTERING_MODE for tracing if event filters were given in config (Closed)
Patch Set: Rebase and add TODO. Created 3 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
« no previous file with comments | « components/tracing/child/child_trace_message_filter.h ('k') | components/tracing/common/trace_startup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/child/child_trace_message_filter.cc
diff --git a/components/tracing/child/child_trace_message_filter.cc b/components/tracing/child/child_trace_message_filter.cc
index 6012a96a8f4291afecf2278757e9c16cde8d9ec2..2cd76dc7b2a29242940e57591919b20ed36d828a 100644
--- a/components/tracing/child/child_trace_message_filter.cc
+++ b/components/tracing/child/child_trace_message_filter.cc
@@ -27,7 +27,9 @@ const int kMinTimeBetweenHistogramChangesInSeconds = 10;
ChildTraceMessageFilter::ChildTraceMessageFilter(
base::SingleThreadTaskRunner* ipc_task_runner)
- : sender_(NULL), ipc_task_runner_(ipc_task_runner) {}
+ : enabled_tracing_modes_(0),
+ sender_(NULL),
+ ipc_task_runner_(ipc_task_runner) {}
void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
sender_ = channel;
@@ -77,13 +79,17 @@ void ChildTraceMessageFilter::OnBeginTracing(
TraceLog::GetInstance()->SetTimeOffset(time_offset);
#endif
MemoryDumpManager::GetInstance()->set_tracing_process_id(tracing_process_id);
- TraceLog::GetInstance()->SetEnabled(
- base::trace_event::TraceConfig(trace_config_str),
- base::trace_event::TraceLog::RECORDING_MODE);
+ const base::trace_event::TraceConfig trace_config(trace_config_str);
+ enabled_tracing_modes_ = base::trace_event::TraceLog::RECORDING_MODE;
+ if (!trace_config.event_filters().empty())
+ enabled_tracing_modes_ |= base::trace_event::TraceLog::FILTERING_MODE;
+ TraceLog::GetInstance()->SetEnabled(trace_config, enabled_tracing_modes_);
}
void ChildTraceMessageFilter::OnEndTracing() {
- TraceLog::GetInstance()->SetDisabled();
+ DCHECK(enabled_tracing_modes_);
+ TraceLog::GetInstance()->SetDisabled(enabled_tracing_modes_);
+ enabled_tracing_modes_ = 0;
// Flush will generate one or more callbacks to OnTraceDataCollected
// synchronously or asynchronously. EndTracingAck will be sent in the last
« no previous file with comments | « components/tracing/child/child_trace_message_filter.h ('k') | components/tracing/common/trace_startup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698