OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/trace_event/trace_config.h" | 5 #include "base/trace_event/trace_config.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 std::string TraceConfig::ToString() const { | 265 std::string TraceConfig::ToString() const { |
266 std::unique_ptr<DictionaryValue> dict = ToDict(); | 266 std::unique_ptr<DictionaryValue> dict = ToDict(); |
267 std::string json; | 267 std::string json; |
268 JSONWriter::Write(*dict, &json); | 268 JSONWriter::Write(*dict, &json); |
269 return json; | 269 return json; |
270 } | 270 } |
271 | 271 |
272 std::unique_ptr<ConvertableToTraceFormat> | 272 std::unique_ptr<ConvertableToTraceFormat> |
273 TraceConfig::AsConvertableToTraceFormat() const { | 273 TraceConfig::AsConvertableToTraceFormat() const { |
274 return WrapUnique(new ConvertableTraceConfigToTraceFormat(*this)); | 274 return MakeUnique<ConvertableTraceConfigToTraceFormat>(*this); |
275 } | 275 } |
276 | 276 |
277 std::string TraceConfig::ToCategoryFilterString() const { | 277 std::string TraceConfig::ToCategoryFilterString() const { |
278 std::string filter_string; | 278 std::string filter_string; |
279 WriteCategoryFilterString(included_categories_, &filter_string, true); | 279 WriteCategoryFilterString(included_categories_, &filter_string, true); |
280 WriteCategoryFilterString(disabled_categories_, &filter_string, true); | 280 WriteCategoryFilterString(disabled_categories_, &filter_string, true); |
281 WriteCategoryFilterString(excluded_categories_, &filter_string, false); | 281 WriteCategoryFilterString(excluded_categories_, &filter_string, false); |
282 WriteCategoryFilterString(synthetic_delays_, &filter_string); | 282 WriteCategoryFilterString(synthetic_delays_, &filter_string); |
283 return filter_string; | 283 return filter_string; |
284 } | 284 } |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 StringPiece str) { | 868 StringPiece str) { |
869 return str.empty() || str.front() == ' ' || str.back() == ' '; | 869 return str.empty() || str.front() == ' ' || str.back() == ' '; |
870 } | 870 } |
871 | 871 |
872 bool TraceConfig::HasIncludedPatterns() const { | 872 bool TraceConfig::HasIncludedPatterns() const { |
873 return !included_categories_.empty(); | 873 return !included_categories_.empty(); |
874 } | 874 } |
875 | 875 |
876 } // namespace trace_event | 876 } // namespace trace_event |
877 } // namespace base | 877 } // namespace base |
OLD | NEW |