| Index: components/tracing/child_trace_message_filter.cc
|
| diff --git a/components/tracing/child_trace_message_filter.cc b/components/tracing/child_trace_message_filter.cc
|
| index d3875c7fa04a7bfa4a921c71164ef5d398194211..8a0e414c088b8e8f9adc643b3a54bb1e2560185b 100644
|
| --- a/components/tracing/child_trace_message_filter.cc
|
| +++ b/components/tracing/child_trace_message_filter.cc
|
| @@ -19,11 +19,14 @@
|
|
|
| void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
|
| channel_ = channel;
|
| + TraceLog::GetInstance()->SetNotificationCallback(
|
| + base::Bind(&ChildTraceMessageFilter::OnTraceNotification, this));
|
| channel_->Send(new TracingHostMsg_ChildSupportsTracing());
|
| }
|
|
|
| void ChildTraceMessageFilter::OnFilterRemoved() {
|
| - channel_ = NULL;
|
| + TraceLog::GetInstance()->SetNotificationCallback(
|
| + TraceLog::NotificationCallback());
|
| }
|
|
|
| bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
| @@ -107,22 +110,12 @@
|
|
|
| void ChildTraceMessageFilter::OnSetWatchEvent(const std::string& category_name,
|
| const std::string& event_name) {
|
| - TraceLog::GetInstance()->SetWatchEvent(
|
| - category_name, event_name,
|
| - base::Bind(&ChildTraceMessageFilter::OnWatchEventMatched, this));
|
| + TraceLog::GetInstance()->SetWatchEvent(category_name.c_str(),
|
| + event_name.c_str());
|
| }
|
|
|
| void ChildTraceMessageFilter::OnCancelWatchEvent() {
|
| TraceLog::GetInstance()->CancelWatchEvent();
|
| -}
|
| -
|
| -void ChildTraceMessageFilter::OnWatchEventMatched() {
|
| - if (!ipc_message_loop_->BelongsToCurrentThread()) {
|
| - ipc_message_loop_->PostTask(FROM_HERE,
|
| - base::Bind(&ChildTraceMessageFilter::OnWatchEventMatched, this));
|
| - return;
|
| - }
|
| - channel_->Send(new TracingHostMsg_WatchEventMatched);
|
| }
|
|
|
| void ChildTraceMessageFilter::OnTraceDataCollected(
|
| @@ -164,4 +157,14 @@
|
| channel_->Send(new TracingHostMsg_CaptureMonitoringSnapshotAck());
|
| }
|
|
|
| +void ChildTraceMessageFilter::OnTraceNotification(int notification) {
|
| + if (!ipc_message_loop_->BelongsToCurrentThread()) {
|
| + ipc_message_loop_->PostTask(FROM_HERE,
|
| + base::Bind(&ChildTraceMessageFilter::OnTraceNotification, this,
|
| + notification));
|
| + return;
|
| + }
|
| + channel_->Send(new TracingHostMsg_TraceNotification(notification));
|
| +}
|
| +
|
| } // namespace tracing
|
|
|