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

Unified Diff: base/trace_event/trace_event_impl.h

Issue 1067233002: Added a trace option for whitewashing trace args against a known-PII-less list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/trace_event/trace_event_impl.cc » ('j') | base/trace_event/trace_event_impl_constants.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_impl.h
diff --git a/base/trace_event/trace_event_impl.h b/base/trace_event/trace_event_impl.h
index c3da0b5e3998a2eb1e6b9019516793aeb1a8aaae..1db05dc40ba022d2b079eb71057eb58fe71d6dfd 100644
--- a/base/trace_event/trace_event_impl.h
+++ b/base/trace_event/trace_event_impl.h
@@ -121,7 +121,7 @@ class BASE_EXPORT TraceEvent {
void UpdateDuration(const TimeTicks& now, const TimeTicks& thread_now);
// Serialize event data to JSON
- void AppendAsJSON(std::string* out) const;
+ void AppendAsJSON(std::string* out, bool enable_args_whitelist) const;
void AppendPrettyPrinted(std::ostringstream* out) const;
static void AppendValueAsJSON(unsigned char type,
@@ -154,6 +154,11 @@ class BASE_EXPORT TraceEvent {
#endif
private:
+ bool IsPIIWhitelisted() const;
+
+ // List of events with args whitelisted for PII.
+ static const char* const kEventArgsWhitelist[][2];
+
// Note: these are ordered by size (largest first) for optimal packing.
TimeTicks timestamp_;
TimeTicks thread_timestamp_;
@@ -382,12 +387,14 @@ struct BASE_EXPORT TraceOptions {
TraceOptions()
: record_mode(RECORD_UNTIL_FULL),
enable_sampling(false),
- enable_systrace(false) {}
+ enable_systrace(false),
+ enable_args_whitelist(false) {}
explicit TraceOptions(TraceRecordMode record_mode)
: record_mode(record_mode),
enable_sampling(false),
- enable_systrace(false) {}
+ enable_systrace(false),
+ enable_args_whitelist(false) {}
// |options_string| is a comma-delimited list of trace options.
// Possible options are: "record-until-full", "record-continuously",
@@ -418,6 +425,7 @@ struct BASE_EXPORT TraceOptions {
TraceRecordMode record_mode;
bool enable_sampling;
bool enable_systrace;
+ bool enable_args_whitelist;
};
struct BASE_EXPORT TraceLogStatus {
@@ -712,7 +720,7 @@ class BASE_EXPORT TraceLog {
// is called for the flush of the current |logged_events_|.
void FlushCurrentThread(int generation);
// Usually it runs on a different thread.
- static void ConvertTraceEventsToTraceFormat(
+ void ConvertTraceEventsToTraceFormat(
scoped_ptr<TraceBuffer> logged_events,
const TraceLog::OutputCallback& flush_output_callback);
void FinishFlush(int generation);
@@ -741,6 +749,7 @@ class BASE_EXPORT TraceLog {
static const InternalTraceOptions kInternalEchoToConsole;
static const InternalTraceOptions kInternalEnableSampling;
static const InternalTraceOptions kInternalRecordAsMuchAsPossible;
+ static const InternalTraceOptions kInternalEnableArgsWhitelist;
// This lock protects TraceLog member accesses (except for members protected
// by thread_info_lock_) from arbitrary threads.
« no previous file with comments | « no previous file | base/trace_event/trace_event_impl.cc » ('j') | base/trace_event/trace_event_impl_constants.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698