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

Unified Diff: net/base/ip_endpoint.h

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/base/host_resolver_proc.cc ('k') | net/base/ip_endpoint.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/ip_endpoint.h
diff --git a/net/base/ip_endpoint.h b/net/base/ip_endpoint.h
index 1c8c90738547763a1de1b008725a49a54570d8dd..7d59e0de1c9100dd7260cff0a70323cffbf52660 100644
--- a/net/base/ip_endpoint.h
+++ b/net/base/ip_endpoint.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -6,7 +6,10 @@
#define NET_BASE_IP_ENDPOINT_H_
#pragma once
+#include <string>
+
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "net/base/net_export.h"
#include "net/base/net_util.h"
@@ -37,19 +40,24 @@ class NET_EXPORT IPEndPoint {
// size of data in |address| available. On output, it is the size of
// the address that was copied into |address|.
// Returns true on success, false on failure.
- bool ToSockAddr(struct sockaddr* address, size_t* address_length) const;
+ bool ToSockAddr(struct sockaddr* address, socklen_t* address_length) const
+ WARN_UNUSED_RESULT;
// Convert from a sockaddr struct.
// |address| is the address.
// |address_length| is the length of |address|.
// Returns true on success, false on failure.
- bool FromSockAddr(const struct sockaddr* address, size_t address_length);
+ bool FromSockAddr(const struct sockaddr* address, socklen_t address_length)
+ WARN_UNUSED_RESULT;
// Returns value as a string (e.g. "127.0.0.1:80"). Returns empty
// string if the address is invalid, and cannot not be converted to a
// string.
std::string ToString() const;
+ // As above, but without port.
+ std::string ToStringWithoutPort() const;
+
bool operator<(const IPEndPoint& that) const;
bool operator==(const IPEndPoint& that) const;
« no previous file with comments | « net/base/host_resolver_proc.cc ('k') | net/base/ip_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698