Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 2422923002: Reduce usage of FOR_EACH_OBSERVER macro in content/browser (Closed)
Patch Set: skip cases in 2418143004 and 2418373002 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/site_instance_impl.cc ('k') | content/browser/webrtc/webrtc_internals.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/site_instance_impl.cc ('k') | content/browser/webrtc/webrtc_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698