Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: base/trace_event/trace_config.cc

Issue 2557743002: tracing: simplify lifetime of TraceEventFilter(s) (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 for (const auto& included_category : included_categories_) { 200 for (const auto& included_category : included_categories_) {
201 if (base::MatchPattern(category_group_token, included_category)) { 201 if (base::MatchPattern(category_group_token, included_category)) {
202 return true; 202 return true;
203 } 203 }
204 } 204 }
205 } 205 }
206 206
207 return false; 207 return false;
208 } 208 }
209 209
210 bool TraceConfig::EventFilterConfig::IsEnabledForCategory(
211 const char* category_name) const {
212 return IsCategoryGroupEnabled(category_name);
213 }
214
210 TraceConfig::TraceConfig() { 215 TraceConfig::TraceConfig() {
211 InitializeDefault(); 216 InitializeDefault();
212 } 217 }
213 218
214 TraceConfig::TraceConfig(StringPiece category_filter_string, 219 TraceConfig::TraceConfig(StringPiece category_filter_string,
215 StringPiece trace_options_string) { 220 StringPiece trace_options_string) {
216 InitializeFromStrings(category_filter_string, trace_options_string); 221 InitializeFromStrings(category_filter_string, trace_options_string);
217 } 222 }
218 223
219 TraceConfig::TraceConfig(StringPiece category_filter_string, 224 TraceConfig::TraceConfig(StringPiece category_filter_string,
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 StringPiece str) { 868 StringPiece str) {
864 return str.empty() || str.front() == ' ' || str.back() == ' '; 869 return str.empty() || str.front() == ' ' || str.back() == ' ';
865 } 870 }
866 871
867 bool TraceConfig::HasIncludedPatterns() const { 872 bool TraceConfig::HasIncludedPatterns() const {
868 return !included_categories_.empty(); 873 return !included_categories_.empty();
869 } 874 }
870 875
871 } // namespace trace_event 876 } // namespace trace_event
872 } // namespace base 877 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698