Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / renderer / p2p / network_list_manager.h
blobc0e0f58bdae37d2cbbfcb5193fe68ed34195813f
1 // Copyright 2014 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.
5 // NetworkListManager interface is introduced to enable unit test on
6 // IpcNetworkManager such that it doesn't depend on implementation of
7 // P2PSocketDispatcher.
9 #ifndef CONTENT_RENDERER_P2P_NETWORK_LIST_MANAGER_H_
10 #define CONTENT_RENDERER_P2P_NETWORK_LIST_MANAGER_H_
12 namespace content {
14 class NetworkListObserver;
16 class CONTENT_EXPORT NetworkListManager {
17 public:
18 // Add a new network list observer. Each observer is called
19 // immidiately after it is registered and then later whenever
20 // network configuration changes. Can be called on any thread. The
21 // observer is always called on the thread it was added.
22 virtual void AddNetworkListObserver(
23 NetworkListObserver* network_list_observer) = 0;
25 // Removes network list observer. Must be called on the thread on
26 // which the observer was added.
27 virtual void RemoveNetworkListObserver(
28 NetworkListObserver* network_list_observer) = 0;
30 protected:
31 // Marked as protected to prevent explicit deletion, as
32 // P2PSocketDispatcher is not owned by IpcNetworkManager.
33 virtual ~NetworkListManager() {}
36 } // namespace content
38 #endif // CONTENT_RENDERER_P2P_NETWORK_LIST_MANAGER_H_