| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #include "content/browser/tracing/tracing_controller_impl.h" | 4 #include "content/browser/tracing/tracing_controller_impl.h" |
| 5 | 5 |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/cpu.h" | 7 #include "base/cpu.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 | 278 |
| 279 if (!callback.is_null()) | 279 if (!callback.is_null()) |
| 280 callback.Run(); | 280 callback.Run(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 bool TracingControllerImpl::StopTracing( | 283 bool TracingControllerImpl::StopTracing( |
| 284 const scoped_refptr<TraceDataSink>& trace_data_sink) { | 284 const scoped_refptr<TraceDataSink>& trace_data_sink) { |
| 285 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 285 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 286 | 286 |
| 287 if (trace_data_sink) | 287 if (trace_data_sink) { |
| 288 if (TraceLog::GetInstance()->GetCurrentTraceConfig() |
| 289 .IsArgumentFilterEnabled()) { |
| 290 trace_data_sink->EnableMetadataFilter(); |
| 291 } |
| 288 trace_data_sink->AddMetadata(*GenerateTracingMetadataDict().get()); | 292 trace_data_sink->AddMetadata(*GenerateTracingMetadataDict().get()); |
| 293 } |
| 289 | 294 |
| 290 if (!can_stop_tracing()) | 295 if (!can_stop_tracing()) |
| 291 return false; | 296 return false; |
| 292 | 297 |
| 293 trace_data_sink_ = trace_data_sink; | 298 trace_data_sink_ = trace_data_sink; |
| 294 // Disable local trace early to avoid traces during end-tracing process from | 299 // Disable local trace early to avoid traces during end-tracing process from |
| 295 // interfering with the process. | 300 // interfering with the process. |
| 296 base::Closure on_stop_tracing_done_callback = base::Bind( | 301 base::Closure on_stop_tracing_done_callback = base::Bind( |
| 297 &TracingControllerImpl::OnStopTracingDone, base::Unretained(this)); | 302 &TracingControllerImpl::OnStopTracingDone, base::Unretained(this)); |
| 298 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 303 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 is_monitoring_ = is_monitoring; | 1048 is_monitoring_ = is_monitoring; |
| 1044 #if !defined(OS_ANDROID) | 1049 #if !defined(OS_ANDROID) |
| 1045 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); | 1050 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); |
| 1046 it != tracing_uis_.end(); it++) { | 1051 it != tracing_uis_.end(); it++) { |
| 1047 (*it)->OnMonitoringStateChanged(is_monitoring); | 1052 (*it)->OnMonitoringStateChanged(is_monitoring); |
| 1048 } | 1053 } |
| 1049 #endif | 1054 #endif |
| 1050 } | 1055 } |
| 1051 | 1056 |
| 1052 } // namespace content | 1057 } // namespace content |
| OLD | NEW |