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

Unified Diff: content/browser/tracing/background_tracing_manager_impl.cc

Issue 1148633007: Hooked the trace event argument whitelist up to the background_trace_manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved tracing enabled callback to its own testing function 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: content/browser/tracing/background_tracing_manager_impl.cc
diff --git a/content/browser/tracing/background_tracing_manager_impl.cc b/content/browser/tracing/background_tracing_manager_impl.cc
index 560e5a4c1e40ba6bfe49eb16c6c9f7a1c06d7aa9..704dd4d3acf568aa6c6cb176b0c2d35d72ebd881 100644
--- a/content/browser/tracing/background_tracing_manager_impl.cc
+++ b/content/browser/tracing/background_tracing_manager_impl.cc
@@ -93,7 +93,7 @@ bool BackgroundTracingManagerImpl::IsSupportedConfig(
bool BackgroundTracingManagerImpl::SetActiveScenario(
scoped_ptr<BackgroundTracingConfig> config,
const BackgroundTracingManager::ReceiveCallback& receive_callback,
- bool requires_anonymized_data) {
+ DataFiltering data_filtering) {
CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (is_tracing_)
return false;
@@ -107,7 +107,7 @@ bool BackgroundTracingManagerImpl::SetActiveScenario(
config_ = config.Pass();
receive_callback_ = receive_callback;
- requires_anonymized_data_ = requires_anonymized_data;
+ requires_anonymized_data_ = (data_filtering == ANONYMIZE_DATA);
EnableRecordingIfConfigNeedsIt();
@@ -227,12 +227,18 @@ void BackgroundTracingManagerImpl::InvalidateTriggerHandlesForTesting() {
trigger_handles_.clear();
}
+void BackgroundTracingManagerImpl::SetTracingEnabledCallbackForTesting(
+ const base::Closure& callback) {
+ tracing_enabled_callback_for_testing_ = callback;
+};
+
void BackgroundTracingManagerImpl::EnableRecording(
base::trace_event::CategoryFilter category_filter) {
+ base::trace_event::TraceOptions trace_options(
+ base::trace_event::RECORD_CONTINUOUSLY);
+ trace_options.enable_argument_filter = requires_anonymized_data_;
is_tracing_ = TracingController::GetInstance()->EnableRecording(
- category_filter,
- base::trace_event::TraceOptions(base::trace_event::RECORD_CONTINUOUSLY),
- TracingController::EnableRecordingDoneCallback());
+ category_filter, trace_options, tracing_enabled_callback_for_testing_);
}
void BackgroundTracingManagerImpl::OnFinalizeStarted(
@@ -241,7 +247,7 @@ void BackgroundTracingManagerImpl::OnFinalizeStarted(
if (!receive_callback_.is_null())
receive_callback_.Run(
- file_contents.get(),
+ file_contents,
base::Bind(&BackgroundTracingManagerImpl::OnFinalizeComplete,
base::Unretained(this)));
}

Powered by Google App Engine
This is Rietveld 408576698