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/guid.h" | 9 #include "base/guid.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 FROM_HERE, base::TimeDelta::FromSeconds(kStartTracingTimeoutSeconds), | 281 FROM_HERE, base::TimeDelta::FromSeconds(kStartTracingTimeoutSeconds), |
282 base::Bind(&TracingControllerImpl::OnAllTracingAgentsStarted, | 282 base::Bind(&TracingControllerImpl::OnAllTracingAgentsStarted, |
283 base::Unretained(this))); | 283 base::Unretained(this))); |
284 | 284 |
285 return true; | 285 return true; |
286 } | 286 } |
287 | 287 |
288 void TracingControllerImpl::OnAllTracingAgentsStarted() { | 288 void TracingControllerImpl::OnAllTracingAgentsStarted() { |
289 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 289 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
290 | 290 |
291 TRACE_EVENT_API_ADD_METADATA_EVENT("IsTimeTicksHighResolution", "value", | |
292 base::TimeTicks::IsHighResolution()); | |
293 TRACE_EVENT_API_ADD_METADATA_EVENT( | 291 TRACE_EVENT_API_ADD_METADATA_EVENT( |
294 "TraceConfig", "value", | 292 TraceLog::GetCategoryGroupEnabled("__metadata"), |
| 293 "IsTimeTicksHighResolution", "value", |
| 294 base::TimeTicks::IsHighResolution()); |
| 295 TRACE_EVENT_API_ADD_METADATA_EVENT( |
| 296 TraceLog::GetCategoryGroupEnabled("__metadata"), "TraceConfig", "value", |
295 start_tracing_trace_config_->AsConvertableToTraceFormat()); | 297 start_tracing_trace_config_->AsConvertableToTraceFormat()); |
296 | 298 |
297 // Notify all child processes. | 299 // Notify all child processes. |
298 for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin(); | 300 for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin(); |
299 it != trace_message_filters_.end(); ++it) { | 301 it != trace_message_filters_.end(); ++it) { |
300 it->get()->SendBeginTracing(*start_tracing_trace_config_); | 302 it->get()->SendBeginTracing(*start_tracing_trace_config_); |
301 } | 303 } |
302 | 304 |
303 if (!start_tracing_done_callback_.is_null()) | 305 if (!start_tracing_done_callback_.is_null()) |
304 start_tracing_done_callback_.Run(); | 306 start_tracing_done_callback_.Run(); |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 const bool global_success = failed_memory_dump_count_ == 0; | 1004 const bool global_success = failed_memory_dump_count_ == 0; |
1003 if (!pending_memory_dump_callback_.is_null()) { | 1005 if (!pending_memory_dump_callback_.is_null()) { |
1004 pending_memory_dump_callback_.Run(pending_memory_dump_guid_, | 1006 pending_memory_dump_callback_.Run(pending_memory_dump_guid_, |
1005 global_success); | 1007 global_success); |
1006 pending_memory_dump_callback_.Reset(); | 1008 pending_memory_dump_callback_.Reset(); |
1007 } | 1009 } |
1008 pending_memory_dump_guid_ = 0; | 1010 pending_memory_dump_guid_ = 0; |
1009 } | 1011 } |
1010 | 1012 |
1011 } // namespace content | 1013 } // namespace content |
OLD | NEW |