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

Unified Diff: base/trace_event/trace_event_impl.cc

Issue 1126553005: Set the content/ trace event PII whitelist to be the arg-filtering predicate in TraceLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@final_dropargs_predicate
Patch Set: 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
« no previous file with comments | « base/trace_event/trace_event_impl.h ('k') | base/trace_event/trace_event_impl_constants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51c95f329b9b5d05075018340137bf9d6866f9c3..f81ce9648a19b9584b916e8644d5605362502615 100644
--- a/base/trace_event/trace_event_impl.cc
+++ b/base/trace_event/trace_event_impl.cc
@@ -67,6 +67,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.
@@ -1008,6 +1009,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;
}
@@ -1037,6 +1040,8 @@ std::string TraceOptions::ToString() const {
ret = ret + "," + kEnableSampling;
if (enable_systrace)
ret = ret + "," + kEnableSystrace;
+ if (enable_args_whitelist)
+ ret = ret + "," + kEnableArgsWhitelist;
return ret;
}
@@ -1501,6 +1506,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;
@@ -1524,6 +1531,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)
« no previous file with comments | « base/trace_event/trace_event_impl.h ('k') | base/trace_event/trace_event_impl_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698