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

Unified Diff: base/trace_event/trace_event_impl.cc

Issue 1115343002: Added a whitelist for trace events that are known to be PII-less. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved whitelist to chrome Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: base/trace_event/trace_event_impl.cc
diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc
index 396bcc23a0417beebf9bc507386643488eeba399..172392b6a7dd9f89699fd35dd068ec1079ea90e4 100644
--- a/base/trace_event/trace_event_impl.cc
+++ b/base/trace_event/trace_event_impl.cc
@@ -68,6 +68,7 @@ const char kRecordAsMuchAsPossible[] = "record-as-much-as-possible";
const char kTraceToConsole[] = "trace-to-console";
const char kEnableSampling[] = "enable-sampling";
const char kEnableSystrace[] = "enable-systrace";
+const char kEnableArgsWhitelist[] = "enable-args-whitelist";
// Controls the number of trace events we will buffer in-memory
// before throwing them away.
@@ -1014,6 +1015,8 @@ bool TraceOptions::SetFromString(const std::string& options_string) {
enable_sampling = true;
} else if (*iter == kEnableSystrace) {
enable_systrace = true;
+ } else if (*iter == kEnableArgsWhitelist) {
+ enable_args_whitelist = true;
} else {
return false;
}
@@ -1043,6 +1046,8 @@ std::string TraceOptions::ToString() const {
ret = ret + "," + kEnableSampling;
if (enable_systrace)
ret = ret + "," + kEnableSystrace;
+ if (enable_args_whitelist)
+ ret = ret + "," + kEnableArgsWhitelist;
return ret;
}
@@ -1500,6 +1505,7 @@ void TraceLog::SetEnabled(const CategoryFilter& category_filter,
void TraceLog::SetEventFilterPredicate(
const TraceEvent::EventFilterPredicate& event_filter_predicate) {
AutoLock lock(lock_);
+ DCHECK(!event_filter_predicate.is_null());
event_filter_predicate_ = event_filter_predicate;
}
@@ -1507,6 +1513,8 @@ TraceLog::InternalTraceOptions TraceLog::GetInternalOptionsFromTraceOptions(
const TraceOptions& options) {
InternalTraceOptions ret =
options.enable_sampling ? kInternalEnableSampling : kInternalNone;
+ if (options.enable_args_whitelist)
+ ret |= kInternalEnableArgsWhitelist;
switch (options.record_mode) {
case RECORD_UNTIL_FULL:
return ret | kInternalRecordUntilFull;
@@ -1530,6 +1538,7 @@ TraceOptions TraceLog::GetCurrentTraceOptions() const {
TraceOptions ret;
InternalTraceOptions option = trace_options();
ret.enable_sampling = (option & kInternalEnableSampling) != 0;
+ ret.enable_args_whitelist = (option & kInternalEnableArgsWhitelist) != 0;
if (option & kInternalRecordUntilFull)
ret.record_mode = RECORD_UNTIL_FULL;
else if (option & kInternalRecordContinuously)

Powered by Google App Engine
This is Rietveld 408576698