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

Unified Diff: net/proxy/proxy_resolver_js_bindings.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 | « net/http/http_stream_parser.cc ('k') | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_js_bindings.cc
diff --git a/net/proxy/proxy_resolver_js_bindings.cc b/net/proxy/proxy_resolver_js_bindings.cc
index 48dab35b2380702c4e59dc15e119fe2a29c7c7e3..dcffe3a3c7ea8900b9045c527321086bd06e43de 100644
--- a/net/proxy/proxy_resolver_js_bindings.cc
+++ b/net/proxy/proxy_resolver_js_bindings.cc
@@ -14,7 +14,6 @@
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
#include "net/base/net_util.h"
-#include "net/base/sys_addrinfo.h"
#include "net/proxy/proxy_resolver_error_observer.h"
#include "net/proxy/proxy_resolver_request_context.h"
#include "net/proxy/sync_host_resolver.h"
@@ -207,7 +206,7 @@ class DefaultJSBindings : public ProxyResolverJSBindings {
// There may be multiple results; we will just use the first one.
// This returns empty string on failure.
- *first_ip_address = net::NetAddressToString(address_list.head());
+ *first_ip_address = address_list.front().ToStringWithoutPort();
if (first_ip_address->empty())
return false;
@@ -227,15 +226,14 @@ class DefaultJSBindings : public ProxyResolverJSBindings {
// Stringify all of the addresses in the address list, separated
// by semicolons.
std::string address_list_str;
- const struct addrinfo* current_address = address_list.head();
- while (current_address) {
+ for (AddressList::const_iterator iter = address_list.begin();
+ iter != address_list.end(); ++iter) {
if (!address_list_str.empty())
address_list_str += ";";
- const std::string address_string = NetAddressToString(current_address);
+ const std::string address_string = iter->ToStringWithoutPort();
if (address_string.empty())
return false;
address_list_str += address_string;
- current_address = current_address->ai_next;
}
*ip_address_list = address_list_str;
« no previous file with comments | « net/http/http_stream_parser.cc ('k') | net/proxy/proxy_resolver_js_bindings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698