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

Side by Side Diff: ppapi/cpp/private/network_list_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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_ 5 #ifndef PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_ 6 #define PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ppapi/c/private/ppb_network_list_private.h" 11 #include "ppapi/c/private/ppb_network_list_private.h"
12 #include "ppapi/cpp/resource.h" 12 #include "ppapi/cpp/resource.h"
13 13
14 namespace pp { 14 namespace pp {
15 15
16 class NetworkListPrivate : public Resource { 16 class NetworkListPrivate : public Resource {
17 public: 17 public:
18 NetworkListPrivate();
18 explicit NetworkListPrivate(PP_Resource resource); 19 explicit NetworkListPrivate(PP_Resource resource);
19 20
20 /// Returns true if the required interface is available. 21 /// Returns true if the required interface is available.
21 static bool IsAvailable(); 22 static bool IsAvailable();
22 23
23 /// @return Returns the number of available network interfaces or 0 24 /// @return Returns the number of available network interfaces or 0
24 /// if the list has never been updated. 25 /// if the list has never been updated.
25 uint32_t GetCount(); 26 uint32_t GetCount() const;
26 27
27 /// @return Returns the name for the network interface with the 28 /// @return Returns the name for the network interface with the
28 /// specified <code>index</code>. 29 /// specified <code>index</code>.
29 std::string GetName(uint32_t index); 30 std::string GetName(uint32_t index) const;
30 31
31 /// @return Returns the type of the network interface with the 32 /// @return Returns the type of the network interface with the
32 /// specified <code>index</code>. 33 /// specified <code>index</code>.
33 PP_NetworkListType_Private GetType(uint32_t index); 34 PP_NetworkListType_Private GetType(uint32_t index) const;
34 35
35 /// @return Returns the current state of the network interface with 36 /// @return Returns the current state of the network interface with
36 /// the specified <code>index</code>. 37 /// the specified <code>index</code>.
37 PP_NetworkListState_Private GetState(uint32_t index); 38 PP_NetworkListState_Private GetState(uint32_t index) const;
38 39
39 /// Gets the list of IP addresses for the network interface with the 40 /// Gets the list of IP addresses for the network interface with the
40 /// specified <code>index</code> and stores them in 41 /// specified <code>index</code> and stores them in
41 /// <code>addresses</code>. 42 /// <code>addresses</code>.
42 void GetIpAddresses(uint32_t index, 43 void GetIpAddresses(uint32_t index,
43 std::vector<PP_NetAddress_Private>* addresses); 44 std::vector<PP_NetAddress_Private>* addresses) const;
44 45
45 /// @return Returns the display name for the network interface with 46 /// @return Returns the display name for the network interface with
46 /// the specified <code>index</code>. 47 /// the specified <code>index</code>.
47 std::string GetDisplayName(uint32_t index); 48 std::string GetDisplayName(uint32_t index) const;
48 49
49 /// @return Returns the MTU for the network interface with the 50 /// @return Returns the MTU for the network interface with the
50 /// specified <code>index</code>. 51 /// specified <code>index</code>.
51 uint32_t GetMTU(uint32_t index); 52 uint32_t GetMTU(uint32_t index) const;
52 }; 53 };
53 54
54 } // namespace pp 55 } // namespace pp
55 56
56 #endif // PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_ 57 #endif // PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698