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

Unified Diff: components/tracing/child_trace_message_filter.cc

Issue 65343006: Use TracingController for startup tracing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « components/tracing/child_trace_message_filter.h ('k') | components/tracing/tracing_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/child_trace_message_filter.cc
diff --git a/components/tracing/child_trace_message_filter.cc b/components/tracing/child_trace_message_filter.cc
index 721c676256f78ecb7abab8084d4d5dbf7eb42558..8a0e414c088b8e8f9adc643b3a54bb1e2560185b 100644
--- a/components/tracing/child_trace_message_filter.cc
+++ b/components/tracing/child_trace_message_filter.cc
@@ -52,8 +52,7 @@ ChildTraceMessageFilter::~ChildTraceMessageFilter() {}
void ChildTraceMessageFilter::OnBeginTracing(
const std::string& category_filter_str,
base::TimeTicks browser_time,
- int options,
- bool tracing_startup) {
+ int options) {
#if defined(__native_client__)
// NaCl and system times are offset by a bit, so subtract some time from
// the captured timestamps. The value might be off by a bit due to messaging
@@ -63,14 +62,9 @@ void ChildTraceMessageFilter::OnBeginTracing(
TraceLog::GetInstance()->SetTimeOffset(time_offset);
#endif
- // Some subprocesses handle --trace-startup by themselves to begin
- // trace as early as possible. Don't start twice, otherwise the trace
- // buffer can't be correctly flushed on the end of startup tracing.
- if (!tracing_startup || !TraceLog::GetInstance()->IsEnabled()) {
- TraceLog::GetInstance()->SetEnabled(
- base::debug::CategoryFilter(category_filter_str),
- static_cast<base::debug::TraceLog::Options>(options));
- }
+ TraceLog::GetInstance()->SetEnabled(
+ base::debug::CategoryFilter(category_filter_str),
+ static_cast<base::debug::TraceLog::Options>(options));
}
void ChildTraceMessageFilter::OnEndTracing() {
@@ -104,11 +98,8 @@ void ChildTraceMessageFilter::OnCaptureMonitoringSnapshot() {
// CaptureMonitoringSnapshotAck below. We are already on the IO thread,
// so the OnMonitoringTraceDataCollected calls will not be deferred.
TraceLog::GetInstance()->FlushButLeaveBufferIntact(
- base::Bind(&ChildTraceMessageFilter::
- OnMonitoringTraceDataCollected,
+ base::Bind(&ChildTraceMessageFilter::OnMonitoringTraceDataCollected,
this));
-
- channel_->Send(new TracingHostMsg_CaptureMonitoringSnapshotAck());
}
void ChildTraceMessageFilter::OnGetTraceBufferPercentFull() {
@@ -161,6 +152,9 @@ void ChildTraceMessageFilter::OnMonitoringTraceDataCollected(
}
channel_->Send(new TracingHostMsg_MonitoringTraceDataCollected(
events_str_ptr->data()));
+
+ if (!has_more_events)
+ channel_->Send(new TracingHostMsg_CaptureMonitoringSnapshotAck());
}
void ChildTraceMessageFilter::OnTraceNotification(int notification) {
« no previous file with comments | « components/tracing/child_trace_message_filter.h ('k') | components/tracing/tracing_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698