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

Side by Side Diff: chrome/common/trace_event_args_whitelist.cc

Issue 2779893005: Continue to clean c_str() calls. (Closed)
Patch Set: Revert changes in font_service_app.cc Created 3 years, 8 months 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
« no previous file with comments | « chrome/common/pepper_flash.cc ('k') | chrome/installer/util/google_chrome_distribution.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/common/trace_event_args_whitelist.h" 5 #include "chrome/common/trace_event_args_whitelist.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/pattern.h" 8 #include "base/strings/pattern.h"
9 #include "base/strings/string_tokenizer.h" 9 #include "base/strings/string_tokenizer.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 DCHECK(arg_name_filter); 68 DCHECK(arg_name_filter);
69 base::CStringTokenizer category_group_tokens( 69 base::CStringTokenizer category_group_tokens(
70 category_group_name, category_group_name + strlen(category_group_name), 70 category_group_name, category_group_name + strlen(category_group_name),
71 ","); 71 ",");
72 while (category_group_tokens.GetNext()) { 72 while (category_group_tokens.GetNext()) {
73 const std::string& category_group_token = category_group_tokens.token(); 73 const std::string& category_group_token = category_group_tokens.token();
74 for (int i = 0; kEventArgsWhitelist[i].category_name != nullptr; ++i) { 74 for (int i = 0; kEventArgsWhitelist[i].category_name != nullptr; ++i) {
75 const WhitelistEntry& whitelist_entry = kEventArgsWhitelist[i]; 75 const WhitelistEntry& whitelist_entry = kEventArgsWhitelist[i];
76 DCHECK(whitelist_entry.event_name); 76 DCHECK(whitelist_entry.event_name);
77 77
78 if (base::MatchPattern(category_group_token.c_str(), 78 if (base::MatchPattern(category_group_token,
79 whitelist_entry.category_name) && 79 whitelist_entry.category_name) &&
80 base::MatchPattern(event_name, whitelist_entry.event_name)) { 80 base::MatchPattern(event_name, whitelist_entry.event_name)) {
81 if (whitelist_entry.arg_name_filter) { 81 if (whitelist_entry.arg_name_filter) {
82 *arg_name_filter = base::Bind(&IsTraceArgumentNameWhitelisted, 82 *arg_name_filter = base::Bind(&IsTraceArgumentNameWhitelisted,
83 whitelist_entry.arg_name_filter); 83 whitelist_entry.arg_name_filter);
84 } 84 }
85 return true; 85 return true;
86 } 86 }
87 } 87 }
88 } 88 }
89 89
90 return false; 90 return false;
91 } 91 }
92 92
93 bool IsMetadataWhitelisted(const std::string& metadata_name) { 93 bool IsMetadataWhitelisted(const std::string& metadata_name) {
94 for (auto* key : kMetadataWhitelist) { 94 for (auto* key : kMetadataWhitelist) {
95 if (base::MatchPattern(metadata_name, key)) { 95 if (base::MatchPattern(metadata_name, key)) {
96 return true; 96 return true;
97 } 97 }
98 } 98 }
99 return false; 99 return false;
100 } 100 }
OLDNEW
« no previous file with comments | « chrome/common/pepper_flash.cc ('k') | chrome/installer/util/google_chrome_distribution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698