| 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 64326d95a73feef83100e9bc721f356b1445517f..eb46e1e47d14885bcd69a89129e079794a9fe147 100644
|
| --- a/content/browser/tracing/background_tracing_manager_impl.cc
|
| +++ b/content/browser/tracing/background_tracing_manager_impl.cc
|
| @@ -93,6 +93,7 @@ bool BackgroundTracingManagerImpl::IsSupportedConfig(
|
| bool BackgroundTracingManagerImpl::SetActiveScenario(
|
| scoped_ptr<BackgroundTracingConfig> config,
|
| const BackgroundTracingManager::ReceiveCallback& receive_callback,
|
| + const base::Closure& enabled_callback,
|
| bool requires_anonymized_data) {
|
| CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
| if (is_tracing_)
|
| @@ -109,19 +110,21 @@ bool BackgroundTracingManagerImpl::SetActiveScenario(
|
| receive_callback_ = receive_callback;
|
| requires_anonymized_data_ = requires_anonymized_data;
|
|
|
| - EnableRecordingIfConfigNeedsIt();
|
| + EnableRecordingIfConfigNeedsIt(enabled_callback);
|
|
|
| return true;
|
| }
|
|
|
| -void BackgroundTracingManagerImpl::EnableRecordingIfConfigNeedsIt() {
|
| +void BackgroundTracingManagerImpl::EnableRecordingIfConfigNeedsIt(
|
| + const base::Closure& enabled_callback) {
|
| if (!config_)
|
| return;
|
|
|
| if (config_->mode == BackgroundTracingConfig::PREEMPTIVE_TRACING_MODE) {
|
| EnableRecording(GetCategoryFilterForCategoryPreset(
|
| - static_cast<BackgroundTracingPreemptiveConfig*>(config_.get())
|
| - ->category_preset));
|
| + static_cast<BackgroundTracingPreemptiveConfig*>(
|
| + config_.get())->category_preset),
|
| + enabled_callback);
|
| } else {
|
| // TODO(simonhatch): Implement reactive tracing path.
|
| NOTREACHED();
|
| @@ -228,11 +231,13 @@ void BackgroundTracingManagerImpl::InvalidateTriggerHandlesForTesting() {
|
| }
|
|
|
| void BackgroundTracingManagerImpl::EnableRecording(
|
| - base::trace_event::CategoryFilter category_filter) {
|
| + base::trace_event::CategoryFilter category_filter,
|
| + const base::Closure& enabled_callback) {
|
| + 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, enabled_callback);
|
| }
|
|
|
| void BackgroundTracingManagerImpl::OnFinalizeStarted(
|
| @@ -241,7 +246,7 @@ void BackgroundTracingManagerImpl::OnFinalizeStarted(
|
|
|
| if (!receive_callback_.is_null())
|
| receive_callback_.Run(
|
| - file_contents.get(),
|
| + file_contents,
|
| base::Bind(&BackgroundTracingManagerImpl::OnFinalizeComplete,
|
| base::Unretained(this)));
|
| }
|
| @@ -263,7 +268,7 @@ void BackgroundTracingManagerImpl::OnFinalizeComplete() {
|
| idle_callback_.Run();
|
|
|
| // Now that a trace has completed, we may need to enable recording again.
|
| - EnableRecordingIfConfigNeedsIt();
|
| + EnableRecordingIfConfigNeedsIt(base::Closure());
|
| }
|
|
|
| void BackgroundTracingManagerImpl::BeginFinalizing(
|
|
|