diff options
author | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 17:31:35 +0000 |
---|---|---|
committer | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 17:31:35 +0000 |
commit | cece099151206e8e1c4d1166dad86c71d3092f1e (patch) | |
tree | c7017f288471d6c0836d7042d1a0046cfdd0859d /components/tracing | |
parent | 02c6ab4dd16ffd395b67f76baac4a2e3ecaa5b52 (diff) | |
download | chromium_src-cece099151206e8e1c4d1166dad86c71d3092f1e.zip chromium_src-cece099151206e8e1c4d1166dad86c71d3092f1e.tar.gz chromium_src-cece099151206e8e1c4d1166dad86c71d3092f1e.tar.bz2 |
Revert of https://codereview.chromium.org/99103004/
Reason for revert: Bug 323749 still unresolved
TBR=
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/101543004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/tracing')
-rw-r--r-- | components/tracing/child_trace_message_filter.cc | 29 | ||||
-rw-r--r-- | components/tracing/child_trace_message_filter.h | 3 | ||||
-rw-r--r-- | components/tracing/tracing_messages.h | 9 |
3 files changed, 23 insertions, 18 deletions
diff --git a/components/tracing/child_trace_message_filter.cc b/components/tracing/child_trace_message_filter.cc index d3875c7..8a0e414 100644 --- a/components/tracing/child_trace_message_filter.cc +++ b/components/tracing/child_trace_message_filter.cc @@ -19,11 +19,14 @@ 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() { - channel_ = NULL; + TraceLog::GetInstance()->SetNotificationCallback( + TraceLog::NotificationCallback()); } bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) { @@ -107,24 +110,14 @@ void ChildTraceMessageFilter::OnGetTraceBufferPercentFull() { 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( const scoped_refptr<base::RefCountedString>& events_str_ptr, bool has_more_events) { @@ -164,4 +157,14 @@ 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 diff --git a/components/tracing/child_trace_message_filter.h b/components/tracing/child_trace_message_filter.h index d2aae3b..cbd300f 100644 --- a/components/tracing/child_trace_message_filter.h +++ b/components/tracing/child_trace_message_filter.h @@ -43,7 +43,6 @@ class ChildTraceMessageFilter : public IPC::ChannelProxy::MessageFilter { void OnSetWatchEvent(const std::string& category_name, const std::string& event_name); void OnCancelWatchEvent(); - void OnWatchEventMatched(); // Callback from trace subsystem. void OnTraceDataCollected( @@ -54,6 +53,8 @@ class ChildTraceMessageFilter : public IPC::ChannelProxy::MessageFilter { const scoped_refptr<base::RefCountedString>& events_str_ptr, bool has_more_events); + void OnTraceNotification(int notification); + IPC::Channel* channel_; base::MessageLoopProxy* ipc_message_loop_; diff --git a/components/tracing/tracing_messages.h b/components/tracing/tracing_messages.h index 1107baf..25b45bd 100644 --- a/components/tracing/tracing_messages.h +++ b/components/tracing/tracing_messages.h @@ -30,7 +30,7 @@ IPC_MESSAGE_CONTROL3(TracingMsg_EnableMonitoring, base::TimeTicks /* browser_time */, int /* base::debug::TraceLog::Options */) -// Sent to all child processes to stop monitoring. +// Sent to all child processes to stop monitoring.. IPC_MESSAGE_CONTROL0(TracingMsg_DisableMonitoring) // Sent to all child processes to capture the current monitorint snapshot. @@ -47,9 +47,6 @@ IPC_MESSAGE_CONTROL2(TracingMsg_SetWatchEvent, // Sent to all child processes to clear watch event. IPC_MESSAGE_CONTROL0(TracingMsg_CancelWatchEvent) -// Sent everytime when a watch event is matched. -IPC_MESSAGE_CONTROL0(TracingHostMsg_WatchEventMatched); - // Notify the browser that this child process supports tracing. IPC_MESSAGE_CONTROL0(TracingHostMsg_ChildSupportsTracing) @@ -60,6 +57,10 @@ IPC_MESSAGE_CONTROL1(TracingHostMsg_EndTracingAck, // Reply from child processes acking TracingMsg_CaptureMonitoringSnapshot. IPC_MESSAGE_CONTROL0(TracingHostMsg_CaptureMonitoringSnapshotAck) +// Sent if the trace buffer becomes full. +IPC_MESSAGE_CONTROL1(TracingHostMsg_TraceNotification, + int /* base::debug::TraceLog::Notification */) + // Child processes send back trace data in JSON chunks. IPC_MESSAGE_CONTROL1(TracingHostMsg_TraceDataCollected, std::string /*json trace data*/) |