summaryrefslogtreecommitdiffstats
path: root/components/tracing/child_trace_message_filter.cc
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 17:31:35 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 17:31:35 +0000
commitcece099151206e8e1c4d1166dad86c71d3092f1e (patch)
treec7017f288471d6c0836d7042d1a0046cfdd0859d /components/tracing/child_trace_message_filter.cc
parent02c6ab4dd16ffd395b67f76baac4a2e3ecaa5b52 (diff)
downloadchromium_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/child_trace_message_filter.cc')
-rw-r--r--components/tracing/child_trace_message_filter.cc29
1 files changed, 16 insertions, 13 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