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 "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/strings/pattern.h" | 9 #include "base/strings/pattern.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 ++ci) { | 202 ++ci) { |
203 if (base::MatchPattern(category_group_token.c_str(), ci->c_str())) { | 203 if (base::MatchPattern(category_group_token.c_str(), ci->c_str())) { |
204 // Current token of category_group_name is present in excluded_list. | 204 // Current token of category_group_name is present in excluded_list. |
205 // Flag the exclusion and proceed further to check if any of the | 205 // Flag the exclusion and proceed further to check if any of the |
206 // remaining categories of category_group_name is not present in the | 206 // remaining categories of category_group_name is not present in the |
207 // excluded_ list. | 207 // excluded_ list. |
208 category_group_disabled = true; | 208 category_group_disabled = true; |
209 break; | 209 break; |
210 } | 210 } |
211 // One of the category of category_group_name is not present in | 211 // One of the category of category_group_name is not present in |
212 // excluded_ list. So, it has to be included_ list. Enable the | 212 // excluded_ list. So, if it's not a disabled-by-default category, |
213 // category_group_name for recording. | 213 // it has to be included_ list. Enable the category_group_name |
214 category_group_disabled = false; | 214 // for recording. |
| 215 if (!base::MatchPattern(category_group_token.c_str(), |
| 216 TRACE_DISABLED_BY_DEFAULT("*"))) { |
| 217 category_group_disabled = false; |
| 218 } |
215 } | 219 } |
216 // One of the categories present in category_group_name is not present in | 220 // One of the categories present in category_group_name is not present in |
217 // excluded_ list. Implies this category_group_name group can be enabled | 221 // excluded_ list. Implies this category_group_name group can be enabled |
218 // for recording, since one of its groups is enabled for recording. | 222 // for recording, since one of its groups is enabled for recording. |
219 if (!category_group_disabled) | 223 if (!category_group_disabled) |
220 break; | 224 break; |
221 } | 225 } |
222 // If the category group is not excluded, and there are no included patterns | 226 // If the category group is not excluded, and there are no included patterns |
223 // we consider this category group enabled, as long as it had categories | 227 // we consider this category group enabled, as long as it had categories |
224 // other than disabled-by-default. | 228 // other than disabled-by-default. |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 str.at(0) == ' ' || | 658 str.at(0) == ' ' || |
655 str.at(str.length() - 1) == ' '; | 659 str.at(str.length() - 1) == ' '; |
656 } | 660 } |
657 | 661 |
658 bool TraceConfig::HasIncludedPatterns() const { | 662 bool TraceConfig::HasIncludedPatterns() const { |
659 return !included_categories_.empty(); | 663 return !included_categories_.empty(); |
660 } | 664 } |
661 | 665 |
662 } // namespace trace_event | 666 } // namespace trace_event |
663 } // namespace base | 667 } // namespace base |
OLD | NEW |