Index: net/base/address_list.h |
=================================================================== |
--- net/base/address_list.h (revision 18213) |
+++ net/base/address_list.h (working copy) |
@@ -20,16 +20,39 @@ |
// object. |
void Adopt(struct addrinfo* head); |
+ // Copies the given addrinfo rather than adopting it. |
+ void Copy(const struct addrinfo* head); |
wtc
2009/06/12 18:40:04
Eric,
In the most common case, we connect to only
eroman
2009/06/12 20:15:22
That seems really weird to me.
- We would be doin
|
+ |
+ // Sets the port of all addresses in the list to |port| (that is the |
+ // sin[6]_port field for the sockaddrs). |
+ void SetPort(int port); |
+ |
+ // Retrieves the port number of the first sockaddr in the list. (If SetPort() |
+ // was previously used on this list, then all the addresses will have this |
+ // same port number.) |
+ int GetPort() const; |
+ |
+ // Sets the address to match |src|, and have each sockaddr's port be |port|. |
+ // If |src| already has the desired port this operation is cheap (just adds |
+ // a reference to |src|'s data.) Otherwise we will make a copy. |
+ void SetFrom(const AddressList& src, int port); |
+ |
+ // Clears all data from this address list. This leaves the list in the same |
+ // empty state as when first constructed. |
+ void Reset(); |
+ |
// Get access to the head of the addrinfo list. |
const struct addrinfo* head() const { return data_->head; } |
private: |
struct Data : public base::RefCountedThreadSafe<Data> { |
- explicit Data(struct addrinfo* ai) : head(ai) {} |
+ Data(struct addrinfo* ai, bool is_system_created) |
+ : head(ai), is_system_created(is_system_created) {} |
~Data(); |
struct addrinfo* head; |
- private: |
- Data(); |
+ |
+ // Indicates which free function to use for |head|. |
+ bool is_system_created; |
}; |
scoped_refptr<Data> data_; |
}; |