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

Unified Diff: chrome/common/trace_event_args_whitelist.cc

Issue 1502583003: [Tracing] Add metadata filter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile failure on win Created 5 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
Index: chrome/common/trace_event_args_whitelist.cc
diff --git a/chrome/common/trace_event_args_whitelist.cc b/chrome/common/trace_event_args_whitelist.cc
index be2a2f90dedaccc1bb51c41b6b43abdd7a640ffb..f88375cd05ba00535840c4a9085a5dcc5f582c3e 100644
--- a/chrome/common/trace_event_args_whitelist.cc
+++ b/chrome/common/trace_event_args_whitelist.cc
@@ -27,6 +27,20 @@ const WhitelistEntry kEventArgsWhitelist[] = {
{"latencyInfo", "*", kInputLatencyAllowedArgs},
{nullptr, nullptr, nullptr}};
+const char* kMetadataWhitelist[] = {
+ "command_line",
+ "cpu-*",
+ "field-trials",
+ "gpu-*",
+ "highres-ticks",
+ "network-type",
+ "num-cpus",
+ "os-*",
+ "physical-memory",
+ "product-version",
+ "user-agent"
+};
+
} // namespace
bool IsTraceArgumentNameWhitelisted(const char* const* granular_filter,
@@ -67,3 +81,12 @@ bool IsTraceEventArgsWhitelisted(
return false;
}
+
+bool IsMetadataWhitelisted(const std::string& metadata_name) {
+ for (auto key : kMetadataWhitelist) {
+ if (base::MatchPattern(metadata_name, key)) {
+ return true;
+ }
+ }
+ return false;
+}
« no previous file with comments | « chrome/common/trace_event_args_whitelist.h ('k') | content/browser/tracing/tracing_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698