• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "base/process/port_provider_mac.h"
6 
7 namespace base {
8 
PortProvider()9 PortProvider::PortProvider() : lock_(), observer_list_() {}
~PortProvider()10 PortProvider::~PortProvider() {}
11 
AddObserver(Observer * observer)12 void PortProvider::AddObserver(Observer* observer) {
13   base::AutoLock l(lock_);
14   observer_list_.AddObserver(observer);
15 }
16 
RemoveObserver(Observer * observer)17 void PortProvider::RemoveObserver(Observer* observer) {
18   base::AutoLock l(lock_);
19   observer_list_.RemoveObserver(observer);
20 }
21 
NotifyObservers(ProcessHandle process)22 void PortProvider::NotifyObservers(ProcessHandle process) {
23   base::AutoLock l(lock_);
24   FOR_EACH_OBSERVER(Observer, observer_list_, OnReceivedTaskPort(process));
25 }
26 
27 }  // namespace base
28