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

Side by Side Diff: ppapi/utility/private/network_list_observer_private.h

Issue 9696051: Add NetworkListObserver utility class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/utility/private/DEPS ('k') | ppapi/utility/private/network_list_observer_private.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 #ifndef PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_
6 #define PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_
7
8 #include "ppapi/cpp/private/network_monitor_private.h"
9
10 namespace pp {
11
12 class NetworkListPrivate;
13
14 /// <code>NetworkListObserver</code> is a wrapper for
15 /// <code>pp::NetworkMonitorPrivate</code> that makes it easier to
16 /// handle network list update notifications. A child class must
17 /// implement the <code>OnNetworkListChanged()</code> method. That
18 /// method will be called once after the object is created and then
19 /// every time network configuration changes.
20 class NetworkListObserverPrivate {
21 public:
22 explicit NetworkListObserverPrivate(const InstanceHandle& instance);
23 virtual ~NetworkListObserverPrivate();
24
25 protected:
26 /// Called once after this object is created and later every time
27 /// network configuration changes. Child classes must implement this
28 /// method.
29 ///
30 /// @param[in] list The current list of network interfaces.
31 virtual void OnNetworkListChanged(const NetworkListPrivate& list) = 0;
32
33 private:
34 static void NetworkListCallbackHandler(void* user_data,
35 PP_Resource list_resource);
36
37 NetworkMonitorPrivate monitor_;
38 };
39
40 } // namespace pp
41
42 #endif // PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_
OLDNEW
« no previous file with comments | « ppapi/utility/private/DEPS ('k') | ppapi/utility/private/network_list_observer_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698