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

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

Issue 9333003: Use FILE thread for disk operations in TraceSubscriberStdio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 7 #include "content/browser/trace_controller.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;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const std::vector<std::string>& known_categories) { 89 const std::vector<std::string>& known_categories) {
90 // 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
91 // child process is compromised. 91 // child process is compromised.
92 if (is_awaiting_end_ack_) { 92 if (is_awaiting_end_ack_) {
93 is_awaiting_end_ack_ = false; 93 is_awaiting_end_ack_ = false;
94 TraceController::GetInstance()->OnEndTracingAck(known_categories); 94 TraceController::GetInstance()->OnEndTracingAck(known_categories);
95 } 95 }
96 } 96 }
97 97
98 void TraceMessageFilter::OnTraceDataCollected(const std::string& data) { 98 void TraceMessageFilter::OnTraceDataCollected(const std::string& data) {
99 TraceController::GetInstance()->OnTraceDataCollected( 99 scoped_refptr<base::RefCountedString> string(new base::RefCountedString());
joth 2012/02/08 13:22:20 avoid calling is 'string' as that's already overlo
Iain Merrick 2012/02/08 14:11:24 Done.
100 make_scoped_refptr(new base::debug::TraceLog::RefCountedString(data))); 100 string->data() = data;
Iain Merrick 2012/02/08 12:07:05 This is a copy, not sure if there's a way to avoid
joth 2012/02/08 13:22:20 At least you're not adding a new copy .. I think i
Iain Merrick 2012/02/08 14:11:24 But I only have a const IPC::Message, so yeah, sad
101 TraceController::GetInstance()->OnTraceDataCollected(string);
101 } 102 }
102 103
103 void TraceMessageFilter::OnTraceBufferFull() { 104 void TraceMessageFilter::OnTraceBufferFull() {
104 TraceController::GetInstance()->OnTraceBufferFull(); 105 TraceController::GetInstance()->OnTraceBufferFull();
105 } 106 }
106 107
107 void TraceMessageFilter::OnTraceBufferPercentFullReply(float percent_full) { 108 void TraceMessageFilter::OnTraceBufferPercentFullReply(float percent_full) {
108 if (is_awaiting_bpf_ack_) { 109 if (is_awaiting_bpf_ack_) {
109 is_awaiting_bpf_ack_ = false; 110 is_awaiting_bpf_ack_ = false;
110 TraceController::GetInstance()->OnTraceBufferPercentFullReply( 111 TraceController::GetInstance()->OnTraceBufferPercentFullReply(
111 percent_full); 112 percent_full);
112 } 113 }
113 } 114 }
114 115
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698