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

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

Issue 10068037: RefCounted types should not have public destructors, content/browser part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MSVC fixes Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/trace_message_filter.h ('k') | content/browser/trace_subscriber_stdio.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/trace_message_filter.h" 5 #include "content/browser/trace_message_filter.h"
6 6
7 #include "content/browser/trace_controller_impl.h" 7 #include "content/browser/trace_controller_impl.h"
8 #include "content/common/child_process_messages.h" 8 #include "content/common/child_process_messages.h"
9 9
10 using content::BrowserMessageFilter; 10 using content::BrowserMessageFilter;
11 using content::BrowserThread; 11 using content::BrowserThread;
12 using content::TraceControllerImpl; 12 using content::TraceControllerImpl;
13 13
14 TraceMessageFilter::TraceMessageFilter() : 14 TraceMessageFilter::TraceMessageFilter() :
15 has_child_(false), 15 has_child_(false),
16 is_awaiting_end_ack_(false), 16 is_awaiting_end_ack_(false),
17 is_awaiting_bpf_ack_(false) { 17 is_awaiting_bpf_ack_(false) {
18 } 18 }
19 19
20 TraceMessageFilter::~TraceMessageFilter() {
21 }
22
23 void TraceMessageFilter::OnFilterAdded(IPC::Channel* channel) { 20 void TraceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
24 // Always on IO thread (BrowserMessageFilter guarantee). 21 // Always on IO thread (BrowserMessageFilter guarantee).
25 BrowserMessageFilter::OnFilterAdded(channel); 22 BrowserMessageFilter::OnFilterAdded(channel);
26 } 23 }
27 24
28 void TraceMessageFilter::OnChannelClosing() { 25 void TraceMessageFilter::OnChannelClosing() {
29 // Always on IO thread (BrowserMessageFilter guarantee). 26 // Always on IO thread (BrowserMessageFilter guarantee).
30 BrowserMessageFilter::OnChannelClosing(); 27 BrowserMessageFilter::OnChannelClosing();
31 28
32 if (has_child_) { 29 if (has_child_) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 Send(new ChildProcessMsg_EndTracing); 71 Send(new ChildProcessMsg_EndTracing);
75 } 72 }
76 73
77 void TraceMessageFilter::SendGetTraceBufferPercentFull() { 74 void TraceMessageFilter::SendGetTraceBufferPercentFull() {
78 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 75 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
79 DCHECK(!is_awaiting_bpf_ack_); 76 DCHECK(!is_awaiting_bpf_ack_);
80 is_awaiting_bpf_ack_ = true; 77 is_awaiting_bpf_ack_ = true;
81 Send(new ChildProcessMsg_GetTraceBufferPercentFull); 78 Send(new ChildProcessMsg_GetTraceBufferPercentFull);
82 } 79 }
83 80
81 TraceMessageFilter::~TraceMessageFilter() {}
82
84 void TraceMessageFilter::OnChildSupportsTracing() { 83 void TraceMessageFilter::OnChildSupportsTracing() {
85 has_child_ = true; 84 has_child_ = true;
86 TraceControllerImpl::GetInstance()->AddFilter(this); 85 TraceControllerImpl::GetInstance()->AddFilter(this);
87 } 86 }
88 87
89 void TraceMessageFilter::OnEndTracingAck( 88 void TraceMessageFilter::OnEndTracingAck(
90 const std::vector<std::string>& known_categories) { 89 const std::vector<std::string>& known_categories) {
91 // is_awaiting_end_ack_ should always be true here, but check in case the 90 // is_awaiting_end_ack_ should always be true here, but check in case the
92 // child process is compromised. 91 // child process is compromised.
93 if (is_awaiting_end_ack_) { 92 if (is_awaiting_end_ack_) {
(...skipping 13 matching lines...) Expand all
107 } 106 }
108 107
109 void TraceMessageFilter::OnTraceBufferPercentFullReply(float percent_full) { 108 void TraceMessageFilter::OnTraceBufferPercentFullReply(float percent_full) {
110 if (is_awaiting_bpf_ack_) { 109 if (is_awaiting_bpf_ack_) {
111 is_awaiting_bpf_ack_ = false; 110 is_awaiting_bpf_ack_ = false;
112 TraceControllerImpl::GetInstance()->OnTraceBufferPercentFullReply( 111 TraceControllerImpl::GetInstance()->OnTraceBufferPercentFullReply(
113 percent_full); 112 percent_full);
114 } 113 }
115 } 114 }
116 115
OLDNEW
« no previous file with comments | « content/browser/trace_message_filter.h ('k') | content/browser/trace_subscriber_stdio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698