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 scoped_ptr<TracingDelegate> delegate( |
| 291 GetContentClient()->browser()->GetTracingDelegate()); |
| 292 if (delegate) { |
| 293 trace_data_sink->SetMetadataFilterPredicate( |
| 294 delegate->GetMetadataFilterPredicate()); |
| 295 } |
| 296 } |
288 trace_data_sink->AddMetadata(*GenerateTracingMetadataDict().get()); | 297 trace_data_sink->AddMetadata(*GenerateTracingMetadataDict().get()); |
| 298 } |
289 | 299 |
290 if (!can_stop_tracing()) | 300 if (!can_stop_tracing()) |
291 return false; | 301 return false; |
292 | 302 |
293 trace_data_sink_ = trace_data_sink; | 303 trace_data_sink_ = trace_data_sink; |
294 // Disable local trace early to avoid traces during end-tracing process from | 304 // Disable local trace early to avoid traces during end-tracing process from |
295 // interfering with the process. | 305 // interfering with the process. |
296 base::Closure on_stop_tracing_done_callback = base::Bind( | 306 base::Closure on_stop_tracing_done_callback = base::Bind( |
297 &TracingControllerImpl::OnStopTracingDone, base::Unretained(this)); | 307 &TracingControllerImpl::OnStopTracingDone, base::Unretained(this)); |
298 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 308 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 is_monitoring_ = is_monitoring; | 1053 is_monitoring_ = is_monitoring; |
1044 #if !defined(OS_ANDROID) | 1054 #if !defined(OS_ANDROID) |
1045 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); | 1055 for (std::set<TracingUI*>::iterator it = tracing_uis_.begin(); |
1046 it != tracing_uis_.end(); it++) { | 1056 it != tracing_uis_.end(); it++) { |
1047 (*it)->OnMonitoringStateChanged(is_monitoring); | 1057 (*it)->OnMonitoringStateChanged(is_monitoring); |
1048 } | 1058 } |
1049 #endif | 1059 #endif |
1050 } | 1060 } |
1051 | 1061 |
1052 } // namespace content | 1062 } // namespace content |
OLD | NEW |