OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "services/tracing/public/cpp/provider.h" | 5 #include "services/tracing/public/cpp/provider.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 bool)>()); | 143 bool)>()); |
144 } | 144 } |
145 | 145 |
146 void Provider::SendChunk( | 146 void Provider::SendChunk( |
147 const scoped_refptr<base::RefCountedString>& events_str, | 147 const scoped_refptr<base::RefCountedString>& events_str, |
148 bool has_more_events) { | 148 bool has_more_events) { |
149 DCHECK(recorder_); | 149 DCHECK(recorder_); |
150 // The string will be empty if an error eccured or there were no trace | 150 // The string will be empty if an error eccured or there were no trace |
151 // events. Empty string is not a valid chunk to record so skip in this case. | 151 // events. Empty string is not a valid chunk to record so skip in this case. |
152 if (!events_str->data().empty()) { | 152 if (!events_str->data().empty()) { |
153 recorder_->Record(mojo::String(events_str->data())); | 153 recorder_->Record(events_str->data()); |
154 } | 154 } |
155 if (!has_more_events) { | 155 if (!has_more_events) { |
156 recorder_.reset(); | 156 recorder_.reset(); |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 } // namespace tracing | 160 } // namespace tracing |
OLD | NEW |