| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 trace_message_filters_.insert(trace_message_filter); | 525 trace_message_filters_.insert(trace_message_filter); |
| 526 if (can_cancel_watch_event()) { | 526 if (can_cancel_watch_event()) { |
| 527 trace_message_filter->SendSetWatchEvent(watch_category_name_, | 527 trace_message_filter->SendSetWatchEvent(watch_category_name_, |
| 528 watch_event_name_); | 528 watch_event_name_); |
| 529 } | 529 } |
| 530 if (can_stop_tracing()) { | 530 if (can_stop_tracing()) { |
| 531 trace_message_filter->SendBeginTracing( | 531 trace_message_filter->SendBeginTracing( |
| 532 TraceLog::GetInstance()->GetCurrentTraceConfig()); | 532 TraceLog::GetInstance()->GetCurrentTraceConfig()); |
| 533 } | 533 } |
| 534 | 534 |
| 535 FOR_EACH_OBSERVER(TraceMessageFilterObserver, trace_message_filter_observers_, | 535 for (auto& observer : trace_message_filter_observers_) |
| 536 OnTraceMessageFilterAdded(trace_message_filter)); | 536 observer.OnTraceMessageFilterAdded(trace_message_filter); |
| 537 } | 537 } |
| 538 | 538 |
| 539 void TracingControllerImpl::RemoveTraceMessageFilter( | 539 void TracingControllerImpl::RemoveTraceMessageFilter( |
| 540 TraceMessageFilter* trace_message_filter) { | 540 TraceMessageFilter* trace_message_filter) { |
| 541 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 541 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 542 BrowserThread::PostTask( | 542 BrowserThread::PostTask( |
| 543 BrowserThread::UI, FROM_HERE, | 543 BrowserThread::UI, FROM_HERE, |
| 544 base::Bind(&TracingControllerImpl::RemoveTraceMessageFilter, | 544 base::Bind(&TracingControllerImpl::RemoveTraceMessageFilter, |
| 545 base::Unretained(this), | 545 base::Unretained(this), |
| 546 base::RetainedRef(trace_message_filter))); | 546 base::RetainedRef(trace_message_filter))); |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 // Schedule the next queued dump (if applicable). | 1116 // Schedule the next queued dump (if applicable). |
| 1117 if (!queued_memory_dump_requests_.empty()) { | 1117 if (!queued_memory_dump_requests_.empty()) { |
| 1118 BrowserThread::PostTask( | 1118 BrowserThread::PostTask( |
| 1119 BrowserThread::UI, FROM_HERE, | 1119 BrowserThread::UI, FROM_HERE, |
| 1120 base::Bind(&TracingControllerImpl::PerformNextQueuedGlobalMemoryDump, | 1120 base::Bind(&TracingControllerImpl::PerformNextQueuedGlobalMemoryDump, |
| 1121 base::Unretained(this))); | 1121 base::Unretained(this))); |
| 1122 } | 1122 } |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 } // namespace content | 1125 } // namespace content |
| OLD | NEW |