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

Unified Diff: ppapi/shared_impl/private/ppb_host_resolver_shared.cc

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get_canonical_name -> canonical_name. iterator to indexing Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/private/ppb_host_resolver_shared.h ('k') | remoting/jingle_glue/ssl_socket_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/private/ppb_host_resolver_shared.cc
diff --git a/ppapi/shared_impl/private/ppb_host_resolver_shared.cc b/ppapi/shared_impl/private/ppb_host_resolver_shared.cc
index af3db6282caec66f9f1e37e32cec67fe91b37a43..9a145a94cfdd5d9fce7bf77491773212b4674dc0 100644
--- a/ppapi/shared_impl/private/ppb_host_resolver_shared.cc
+++ b/ppapi/shared_impl/private/ppb_host_resolver_shared.cc
@@ -7,7 +7,7 @@
#include <cstddef>
#include <cstring>
-#include "net/base/sys_addrinfo.h"
+#include "net/base/address_list.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/shared_impl/private/net_address_private_impl.h"
#include "ppapi/shared_impl/var.h"
@@ -15,17 +15,15 @@
namespace ppapi {
-NetAddressList* CreateNetAddressListFromAddrInfo(const addrinfo* ai) {
+NetAddressList* CreateNetAddressListFromAddressList(
+ const net::AddressList& list) {
scoped_ptr<NetAddressList> net_address_list(new NetAddressList());
PP_NetAddress_Private address;
- while (ai != NULL) {
- if (!NetAddressPrivateImpl::SockaddrToNetAddress(
- ai->ai_addr, ai->ai_addrlen, &address)) {
+ for (size_t i = 0; i < list.size(); ++i) {
+ if (!NetAddressPrivateImpl::IPEndPointToNetAddress(list[i], &address))
return NULL;
- }
net_address_list->push_back(address);
- ai = ai->ai_next;
}
return net_address_list.release();
« no previous file with comments | « ppapi/shared_impl/private/ppb_host_resolver_shared.h ('k') | remoting/jingle_glue/ssl_socket_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698