OLD | NEW |
1 // Copyright (c) 2012 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; |
11 using content::BrowserThread; | 11 using content::BrowserThread; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 scoped_refptr<base::RefCountedString> data_ptr(new base::RefCountedString()); | 99 TraceController::GetInstance()->OnTraceDataCollected( |
100 data_ptr->data() = data; | 100 make_scoped_refptr(new base::debug::TraceLog::RefCountedString(data))); |
101 TraceController::GetInstance()->OnTraceDataCollected(data_ptr); | |
102 } | 101 } |
103 | 102 |
104 void TraceMessageFilter::OnTraceBufferFull() { | 103 void TraceMessageFilter::OnTraceBufferFull() { |
105 TraceController::GetInstance()->OnTraceBufferFull(); | 104 TraceController::GetInstance()->OnTraceBufferFull(); |
106 } | 105 } |
107 | 106 |
108 void TraceMessageFilter::OnTraceBufferPercentFullReply(float percent_full) { | 107 void TraceMessageFilter::OnTraceBufferPercentFullReply(float percent_full) { |
109 if (is_awaiting_bpf_ack_) { | 108 if (is_awaiting_bpf_ack_) { |
110 is_awaiting_bpf_ack_ = false; | 109 is_awaiting_bpf_ack_ = false; |
111 TraceController::GetInstance()->OnTraceBufferPercentFullReply( | 110 TraceController::GetInstance()->OnTraceBufferPercentFullReply( |
112 percent_full); | 111 percent_full); |
113 } | 112 } |
114 } | 113 } |
115 | 114 |
OLD | NEW |