diff options
author | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-02 23:43:48 +0000 |
---|---|---|
committer | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-02 23:43:48 +0000 |
commit | 398752be784a614f6267b2a4840d70e475266a92 (patch) | |
tree | 84a3cf0e843e4d60cae31dad374c8f720a77e512 /components/tracing/child_trace_message_filter.cc | |
parent | f9c764b9f07e6b1ebed375480e421376d7139317 (diff) | |
download | chromium_src-398752be784a614f6267b2a4840d70e475266a92.zip chromium_src-398752be784a614f6267b2a4840d70e475266a92.tar.gz chromium_src-398752be784a614f6267b2a4840d70e475266a92.tar.bz2 |
Revert "Revert 237280 "Remove TraceController""
This reverts commit 6aa58b8599840160df945afa89e7482d14d1c4d4.
Fixed double-close issue when ending recording.
> Revert 237280 "Remove TraceController"
>
> Seems to have broken trace-based telemetry benchmarks on android.
>
> BUG=323749
>
> > Remove TraceController
> >
> > TraceController is obsoleted by TracingController.
> > Changed all remaining clients to use TracingController.
> >
> > BUG=none
> >
> > Review URL: https://codereview.chromium.org/67683003
>
> TBR=wangxianzhu@chromium.org
>
> Review URL: https://codereview.chromium.org/89753004
>
> git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237452 0039d316-1c4b-4281-b951-d872f2087c98
TBR=wangxianzhu@chromium.org
Review URL: https://codereview.chromium.org/99103004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/tracing/child_trace_message_filter.cc')
-rw-r--r-- | components/tracing/child_trace_message_filter.cc | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/components/tracing/child_trace_message_filter.cc b/components/tracing/child_trace_message_filter.cc index 8a0e414..d3875c7 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) { @@ -110,14 +107,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, event_name, + 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( 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 |