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

Unified Diff: content/browser/tracing/trace_message_filter.cc

Issue 101543004: Revert of Revert "Revert 237280 "Remove TraceController"" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
« no previous file with comments | « content/browser/tracing/trace_message_filter.h ('k') | content/browser/tracing/trace_subscriber_stdio.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/trace_message_filter.cc
diff --git a/content/browser/tracing/trace_message_filter.cc b/content/browser/tracing/trace_message_filter.cc
index 35f23dc10259574e808be9a775d36b74b0e72a7d..00fffb9900e2922711c794eda9e237a15a91ab9c 100644
--- a/content/browser/tracing/trace_message_filter.cc
+++ b/content/browser/tracing/trace_message_filter.cc
@@ -5,6 +5,7 @@
#include "content/browser/tracing/trace_message_filter.h"
#include "components/tracing/tracing_messages.h"
+#include "content/browser/tracing/trace_controller_impl.h"
#include "content/browser/tracing/tracing_controller_impl.h"
namespace content {
@@ -15,8 +16,6 @@
is_awaiting_capture_monitoring_snapshot_ack_(false),
is_awaiting_buffer_percent_full_ack_(false) {
}
-
-TraceMessageFilter::~TraceMessageFilter() {}
void TraceMessageFilter::OnChannelClosing() {
if (has_child_) {
@@ -29,7 +28,8 @@
if (is_awaiting_buffer_percent_full_ack_)
OnTraceBufferPercentFullReply(0.0f);
- TracingControllerImpl::GetInstance()->RemoveTraceMessageFilter(this);
+ TraceControllerImpl::GetInstance()->RemoveFilter(this);
+ TracingControllerImpl::GetInstance()->RemoveFilter(this);
}
}
@@ -47,8 +47,8 @@
OnTraceDataCollected)
IPC_MESSAGE_HANDLER(TracingHostMsg_MonitoringTraceDataCollected,
OnMonitoringTraceDataCollected)
- IPC_MESSAGE_HANDLER(TracingHostMsg_WatchEventMatched,
- OnWatchEventMatched)
+ IPC_MESSAGE_HANDLER(TracingHostMsg_TraceNotification,
+ OnTraceNotification)
IPC_MESSAGE_HANDLER(TracingHostMsg_TraceBufferPercentFullReply,
OnTraceBufferPercentFullReply)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -109,9 +109,12 @@
Send(new TracingMsg_CancelWatchEvent);
}
+TraceMessageFilter::~TraceMessageFilter() {}
+
void TraceMessageFilter::OnChildSupportsTracing() {
has_child_ = true;
- TracingControllerImpl::GetInstance()->AddTraceMessageFilter(this);
+ TraceControllerImpl::GetInstance()->AddFilter(this);
+ TracingControllerImpl::GetInstance()->AddFilter(this);
}
void TraceMessageFilter::OnEndTracingAck(
@@ -120,6 +123,7 @@
// child process is compromised.
if (is_awaiting_end_ack_) {
is_awaiting_end_ack_ = false;
+ TraceControllerImpl::GetInstance()->OnEndTracingAck(known_categories);
TracingControllerImpl::GetInstance()->OnDisableRecordingAcked(
known_categories);
} else {
@@ -141,6 +145,7 @@
void TraceMessageFilter::OnTraceDataCollected(const std::string& data) {
scoped_refptr<base::RefCountedString> data_ptr(new base::RefCountedString());
data_ptr->data() = data;
+ TraceControllerImpl::GetInstance()->OnTraceDataCollected(data_ptr);
TracingControllerImpl::GetInstance()->OnTraceDataCollected(data_ptr);
}
@@ -152,13 +157,15 @@
data_ptr);
}
-void TraceMessageFilter::OnWatchEventMatched() {
- TracingControllerImpl::GetInstance()->OnWatchEventMatched();
+void TraceMessageFilter::OnTraceNotification(int notification) {
+ TraceControllerImpl::GetInstance()->OnTraceNotification(notification);
}
void TraceMessageFilter::OnTraceBufferPercentFullReply(float percent_full) {
if (is_awaiting_buffer_percent_full_ack_) {
is_awaiting_buffer_percent_full_ack_ = false;
+ TraceControllerImpl::GetInstance()->OnTraceBufferPercentFullReply(
+ percent_full);
TracingControllerImpl::GetInstance()->OnTraceBufferPercentFullReply(
percent_full);
} else {
« no previous file with comments | « content/browser/tracing/trace_message_filter.h ('k') | content/browser/tracing/trace_subscriber_stdio.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698