| 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 9b0fa81ea84ff4845d1198fe1e966237b6a7f9cf..7243566375edd2b6c7b5c0e20a1151dfbf8732bb 100644
|
| --- a/components/tracing/child_trace_message_filter.cc
|
| +++ b/components/tracing/child_trace_message_filter.cc
|
| @@ -19,14 +19,11 @@ ChildTraceMessageFilter::ChildTraceMessageFilter(
|
|
|
| void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
|
| channel_ = channel;
|
| - TraceLog::GetInstance()->SetNotificationCallback(
|
| - base::Bind(&ChildTraceMessageFilter::OnTraceNotification, this));
|
| channel_->Send(new TracingHostMsg_ChildSupportsTracing());
|
| }
|
|
|
| void ChildTraceMessageFilter::OnFilterRemoved() {
|
| - TraceLog::GetInstance()->SetNotificationCallback(
|
| - TraceLog::NotificationCallback());
|
| + channel_ = NULL;
|
| }
|
|
|
| bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
| @@ -113,14 +110,24 @@ void ChildTraceMessageFilter::OnGetTraceBufferPercentFull() {
|
|
|
| void ChildTraceMessageFilter::OnSetWatchEvent(const std::string& category_name,
|
| const std::string& event_name) {
|
| - TraceLog::GetInstance()->SetWatchEvent(category_name.c_str(),
|
| - event_name.c_str());
|
| + TraceLog::GetInstance()->SetWatchEvent(
|
| + category_name.c_str(), event_name.c_str(),
|
| + base::Bind(&ChildTraceMessageFilter::OnWatchEventMatched, this));
|
| }
|
|
|
| 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(
|
| const scoped_refptr<base::RefCountedString>& events_str_ptr,
|
| bool has_more_events) {
|
| @@ -157,14 +164,4 @@ void ChildTraceMessageFilter::OnMonitoringTraceDataCollected(
|
| events_str_ptr->data()));
|
| }
|
|
|
| -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
|
|
|