Chromium Code Reviews| Index: ppapi/shared_impl/private/network_list.h |
| diff --git a/ppapi/shared_impl/private/network_list.h b/ppapi/shared_impl/private/network_list.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fb32164ef6276a8ba8e31e559140320d1bf6415e |
| --- /dev/null |
| +++ b/ppapi/shared_impl/private/network_list.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright (c) 2012 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 PPAPI_SHARED_IMPL_PRIVATE_NETWORK_LIST_H_ |
| +#define PPAPI_SHARED_IMPL_PRIVATE_NETWORK_LIST_H_ |
| + |
| +#include <cstddef> |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "ppapi/c/private/ppb_net_address_private.h" |
| + |
| +struct addrinfo; |
| + |
| +namespace ppapi { |
| + |
| +// NetworkList is a list of <host canonical name, host address> pairs, |
| +// where canonical name is a string and host address is a |
| +// PP_NetAddress_Private. Used in PPB_HostResolver_Shared as internal |
| +// container of <name, address> pairs, also used in IPC between |
| +// renderer and browser (for HostResolver responses). |
| +class NetworkList { |
|
yzshen1
2012/02/28 08:29:00
Comparing to NetworkList, I prefer std::vector<Sim
ygorshenin1
2012/02/28 12:09:47
Thanks! I replaced the hand-written NetworkList to
|
| + public: |
| + NetworkList(); |
| + virtual ~NetworkList(); |
|
yzshen1
2012/02/28 08:29:00
It doesn't need to be virtual.
ygorshenin1
2012/02/28 12:09:47
NetworkList is removed.
On 2012/02/28 08:29:00, y
|
| + |
| + static NetworkList* CreateFromAddrInfo(const addrinfo* ai); |
| + |
| + void Clear(); |
| + void Append(const std::string& canonical_name, |
| + const PP_NetAddress_Private& address); |
| + size_t GetSize() const; |
| + bool GetItem(size_t index, |
| + std::string* canonical_name, |
| + PP_NetAddress_Private* address) const; |
| + |
| + private: |
| + std::vector<std::string> canonical_name_list_; |
| + std::vector<PP_NetAddress_Private> address_list_; |
| +}; |
| + |
| +} // namespace ppapi |
| + |
| +#endif // PPAPI_SHARED_IMPL_PRIVATE_NETWORK_LIST_H_ |