Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: trunk/src/components/tracing/child_trace_message_filter.cc

Issue 89753004: Revert 237280 "Remove TraceController" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/components/tracing/child_trace_message_filter.cc
===================================================================
--- trunk/src/components/tracing/child_trace_message_filter.cc (revision 237451)
+++ trunk/src/components/tracing/child_trace_message_filter.cc (working copy)
@@ -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,24 +110,14 @@
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 @@
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
« no previous file with comments | « trunk/src/components/tracing/child_trace_message_filter.h ('k') | trunk/src/components/tracing/tracing_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698