Home | History | Annotate | Download | only in p2p
      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.
      4 
      5 // NetworkListManager interface is introduced to enable unit test on
      6 // IpcNetworkManager such that it doesn't depend on implementation of
      7 // P2PSocketDispatcher.
      8 
      9 #ifndef CONTENT_RENDERER_P2P_NETWORK_LIST_MANAGER_H_
     10 #define CONTENT_RENDERER_P2P_NETWORK_LIST_MANAGER_H_
     11 
     12 namespace content {
     13 
     14 class NetworkListObserver;
     15 
     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;
     24 
     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;
     29 
     30  protected:
     31   // Marked as protected to prevent explicit deletion, as
     32   // P2PSocketDispatcher is not owned by IpcNetworkManager.
     33   virtual ~NetworkListManager() {}
     34 };
     35 
     36 }  // namespace content
     37 
     38 #endif  // CONTENT_RENDERER_P2P_NETWORK_LIST_MANAGER_H_
     39