| 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 637 |
| 638 for (size_t event_filter_index = 0; | 638 for (size_t event_filter_index = 0; |
| 639 event_filter_index < category_event_filters.GetSize(); | 639 event_filter_index < category_event_filters.GetSize(); |
| 640 ++event_filter_index) { | 640 ++event_filter_index) { |
| 641 const base::DictionaryValue* event_filter = nullptr; | 641 const base::DictionaryValue* event_filter = nullptr; |
| 642 if (!category_event_filters.GetDictionary(event_filter_index, | 642 if (!category_event_filters.GetDictionary(event_filter_index, |
| 643 &event_filter)) | 643 &event_filter)) |
| 644 continue; | 644 continue; |
| 645 | 645 |
| 646 std::string predicate_name; | 646 std::string predicate_name; |
| 647 CHECK(event_filter->GetString(kFilterPredicateParam, &predicate_name)) | 647 // Invalid predicate name in category event filter. |
| 648 << "Invalid predicate name in category event filter."; | 648 CHECK(event_filter->GetString(kFilterPredicateParam, &predicate_name)); |
| 649 | 649 |
| 650 EventFilterConfig new_config(predicate_name); | 650 EventFilterConfig new_config(predicate_name); |
| 651 const base::ListValue* included_list = nullptr; | 651 const base::ListValue* included_list = nullptr; |
| 652 CHECK(event_filter->GetList(kIncludedCategoriesParam, &included_list)) | 652 // Missing included_categories in category event filter. |
| 653 << "Missing included_categories in category event filter."; | 653 CHECK(event_filter->GetList(kIncludedCategoriesParam, &included_list)); |
| 654 | 654 |
| 655 for (size_t i = 0; i < included_list->GetSize(); ++i) { | 655 for (size_t i = 0; i < included_list->GetSize(); ++i) { |
| 656 std::string category; | 656 std::string category; |
| 657 if (included_list->GetString(i, &category)) | 657 if (included_list->GetString(i, &category)) |
| 658 new_config.AddIncludedCategory(category); | 658 new_config.AddIncludedCategory(category); |
| 659 } | 659 } |
| 660 | 660 |
| 661 const base::ListValue* excluded_list = nullptr; | 661 const base::ListValue* excluded_list = nullptr; |
| 662 if (event_filter->GetList(kExcludedCategoriesParam, &excluded_list)) { | 662 if (event_filter->GetList(kExcludedCategoriesParam, &excluded_list)) { |
| 663 for (size_t i = 0; i < excluded_list->GetSize(); ++i) { | 663 for (size_t i = 0; i < excluded_list->GetSize(); ++i) { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 StringPiece str) { | 849 StringPiece str) { |
| 850 return str.empty() || str.front() == ' ' || str.back() == ' '; | 850 return str.empty() || str.front() == ' ' || str.back() == ' '; |
| 851 } | 851 } |
| 852 | 852 |
| 853 bool TraceConfig::HasIncludedPatterns() const { | 853 bool TraceConfig::HasIncludedPatterns() const { |
| 854 return !included_categories_.empty(); | 854 return !included_categories_.empty(); |
| 855 } | 855 } |
| 856 | 856 |
| 857 } // namespace trace_event | 857 } // namespace trace_event |
| 858 } // namespace base | 858 } // namespace base |
| OLD | NEW |