| OLD | NEW |
| 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 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 TraceController::GetInstance()->OnTraceDataCollected( | 99 scoped_refptr<base::RefCountedString> data_ptr(new base::RefCountedString()); |
| 100 make_scoped_refptr(new base::debug::TraceLog::RefCountedString(data))); | 100 data_ptr->data() = data; |
| 101 TraceController::GetInstance()->OnTraceDataCollected(data_ptr); |
| 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 |
| OLD | NEW |