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

Unified Diff: src/libplatform/tracing/trace-config.cc

Issue 2558193002: [Tracing] Support multi-categories group list. (Closed)
Patch Set: Add tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/libplatform/test-tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libplatform/tracing/trace-config.cc
diff --git a/src/libplatform/tracing/trace-config.cc b/src/libplatform/tracing/trace-config.cc
index e77d191e5e1cc32737d205842a1fd80d00e35ebf..9156301a45843486b0994a1670459b9bcb404afa 100644
--- a/src/libplatform/tracing/trace-config.cc
+++ b/src/libplatform/tracing/trace-config.cc
@@ -21,8 +21,13 @@ TraceConfig* TraceConfig::CreateDefaultTraceConfig() {
}
bool TraceConfig::IsCategoryGroupEnabled(const char* category_group) const {
- for (auto included_category : included_categories_) {
- if (strcmp(included_category.data(), category_group) == 0) return true;
+ std::stringstream category_stream(category_group);
+ while (category_stream.good()) {
+ std::string category;
+ getline(category_stream, category, ',');
+ for (auto included_category : included_categories_) {
+ if (category == included_category) return true;
+ }
}
return false;
}
« no previous file with comments | « no previous file | test/cctest/libplatform/test-tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698