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

Side by Side Diff: base/process/port_provider_mac.cc

Issue 2418933004: Reduce usage of FOR_EACH_OBSERVER macro in base (Closed)
Patch Set: 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 | « base/observer_list_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 4
5 #include "base/process/port_provider_mac.h" 5 #include "base/process/port_provider_mac.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 PortProvider::PortProvider() : lock_(), observer_list_() {} 9 PortProvider::PortProvider() : lock_(), observer_list_() {}
10 PortProvider::~PortProvider() {} 10 PortProvider::~PortProvider() {}
11 11
12 void PortProvider::AddObserver(Observer* observer) { 12 void PortProvider::AddObserver(Observer* observer) {
13 base::AutoLock l(lock_); 13 base::AutoLock l(lock_);
14 observer_list_.AddObserver(observer); 14 observer_list_.AddObserver(observer);
15 } 15 }
16 16
17 void PortProvider::RemoveObserver(Observer* observer) { 17 void PortProvider::RemoveObserver(Observer* observer) {
18 base::AutoLock l(lock_); 18 base::AutoLock l(lock_);
19 observer_list_.RemoveObserver(observer); 19 observer_list_.RemoveObserver(observer);
20 } 20 }
21 21
22 void PortProvider::NotifyObservers(ProcessHandle process) { 22 void PortProvider::NotifyObservers(ProcessHandle process) {
23 base::AutoLock l(lock_); 23 base::AutoLock l(lock_);
24 FOR_EACH_OBSERVER(Observer, observer_list_, OnReceivedTaskPort(process)); 24 for (auto& observer : observer_list_)
25 observer.OnReceivedTaskPort(process);
25 } 26 }
26 27
27 } // namespace base 28 } // namespace base
OLDNEW
« no previous file with comments | « base/observer_list_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698