blob: 05a9cac2d3084a90e01e3e6d11837d802ec87e4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_ARC_CONNECTION_NOTIFIER_H_
#define COMPONENTS_ARC_CONNECTION_NOTIFIER_H_
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/threading/thread_checker.h"
namespace arc {
namespace internal {
class ConnectionObserverBase;
// Manages events related to connection. Designed to be used only by
// ConnectionHolder.
class ConnectionNotifier {
public:
ConnectionNotifier();
~ConnectionNotifier();
void AddObserver(ConnectionObserverBase* observer);
void RemoveObserver(ConnectionObserverBase* observer);
// Notifies observers that connection gets ready.
void NotifyConnectionReady();
// Notifies observers that connection is closed.
void NotifyConnectionClosed();
private:
THREAD_CHECKER(thread_checker_);
base::ObserverList<ConnectionObserverBase> observer_list_;
DISALLOW_COPY_AND_ASSIGN(ConnectionNotifier);
};
} // namespace internal
} // namespace arc
#endif // COMPONENTS_ARC_CONNECTION_NOTIFIER_H_
|