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

Side by Side Diff: content/browser/tracing/trace_message_filter.cc

Issue 425593002: Refactor trace_event_impl's SetEnabled to use TraceOptions. Propagate this through the whole stack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address joechan's comments Created 6 years, 4 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tracing/trace_message_filter.h" 5 #include "content/browser/tracing/trace_message_filter.h"
6 6
7 #include "components/tracing/tracing_messages.h" 7 #include "components/tracing/tracing_messages.h"
8 #include "content/browser/tracing/tracing_controller_impl.h" 8 #include "content/browser/tracing/tracing_controller_impl.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 IPC_MESSAGE_HANDLER(TracingHostMsg_WatchEventMatched, 50 IPC_MESSAGE_HANDLER(TracingHostMsg_WatchEventMatched,
51 OnWatchEventMatched) 51 OnWatchEventMatched)
52 IPC_MESSAGE_HANDLER(TracingHostMsg_TraceBufferPercentFullReply, 52 IPC_MESSAGE_HANDLER(TracingHostMsg_TraceBufferPercentFullReply,
53 OnTraceBufferPercentFullReply) 53 OnTraceBufferPercentFullReply)
54 IPC_MESSAGE_UNHANDLED(handled = false) 54 IPC_MESSAGE_UNHANDLED(handled = false)
55 IPC_END_MESSAGE_MAP() 55 IPC_END_MESSAGE_MAP()
56 return handled; 56 return handled;
57 } 57 }
58 58
59 void TraceMessageFilter::SendBeginTracing( 59 void TraceMessageFilter::SendBeginTracing(
60 const std::string& category_filter_str, 60 const base::debug::CategoryFilter& category_filter,
61 base::debug::TraceLog::Options options) { 61 const base::debug::TraceOptions& options) {
62 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 62 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
63 Send(new TracingMsg_BeginTracing(category_filter_str, 63 Send(new TracingMsg_BeginTracing(category_filter.ToString(),
64 base::TimeTicks::NowFromSystemTraceTime(), 64 base::TimeTicks::NowFromSystemTraceTime(),
65 options)); 65 options.ToString()));
66 } 66 }
67 67
68 void TraceMessageFilter::SendEndTracing() { 68 void TraceMessageFilter::SendEndTracing() {
69 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 69 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
70 DCHECK(!is_awaiting_end_ack_); 70 DCHECK(!is_awaiting_end_ack_);
71 is_awaiting_end_ack_ = true; 71 is_awaiting_end_ack_ = true;
72 Send(new TracingMsg_EndTracing); 72 Send(new TracingMsg_EndTracing);
73 } 73 }
74 74
75 void TraceMessageFilter::SendEnableMonitoring( 75 void TraceMessageFilter::SendEnableMonitoring(
76 const std::string& category_filter_str, 76 const base::debug::CategoryFilter& category_filter,
77 base::debug::TraceLog::Options options) { 77 const base::debug::TraceOptions& options) {
78 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 78 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
79 Send(new TracingMsg_EnableMonitoring(category_filter_str, 79 Send(new TracingMsg_EnableMonitoring(category_filter.ToString(),
80 base::TimeTicks::NowFromSystemTraceTime(), 80 base::TimeTicks::NowFromSystemTraceTime(),
81 options)); 81 options.ToString()));
82 } 82 }
83 83
84 void TraceMessageFilter::SendDisableMonitoring() { 84 void TraceMessageFilter::SendDisableMonitoring() {
85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
86 Send(new TracingMsg_DisableMonitoring); 86 Send(new TracingMsg_DisableMonitoring);
87 } 87 }
88 88
89 void TraceMessageFilter::SendCaptureMonitoringSnapshot() { 89 void TraceMessageFilter::SendCaptureMonitoringSnapshot() {
90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
91 DCHECK(!is_awaiting_capture_monitoring_snapshot_ack_); 91 DCHECK(!is_awaiting_capture_monitoring_snapshot_ack_);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if (is_awaiting_buffer_percent_full_ack_) { 161 if (is_awaiting_buffer_percent_full_ack_) {
162 is_awaiting_buffer_percent_full_ack_ = false; 162 is_awaiting_buffer_percent_full_ack_ = false;
163 TracingControllerImpl::GetInstance()->OnTraceBufferPercentFullReply( 163 TracingControllerImpl::GetInstance()->OnTraceBufferPercentFullReply(
164 this, percent_full); 164 this, percent_full);
165 } else { 165 } else {
166 NOTREACHED(); 166 NOTREACHED();
167 } 167 }
168 } 168 }
169 169
170 } // namespace content 170 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/trace_message_filter.h ('k') | content/browser/tracing/tracing_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698