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

Side by Side Diff: net/base/address_list.h

Issue 6598040: Add constructor for creating an AddressList from a struct sockaddr. This is... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/address_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_ADDRESS_LIST_H_ 5 #ifndef NET_BASE_ADDRESS_LIST_H_
6 #define NET_BASE_ADDRESS_LIST_H_ 6 #define NET_BASE_ADDRESS_LIST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // |canonical_name| must be a non-null value. 67 // |canonical_name| must be a non-null value.
68 bool GetCanonicalName(std::string* canonical_name) const; 68 bool GetCanonicalName(std::string* canonical_name) const;
69 69
70 // Clears all data from this address list. This leaves the list in the same 70 // Clears all data from this address list. This leaves the list in the same
71 // empty state as when first constructed. 71 // empty state as when first constructed.
72 void Reset(); 72 void Reset();
73 73
74 // Get access to the head of the addrinfo list. 74 // Get access to the head of the addrinfo list.
75 const struct addrinfo* head() const; 75 const struct addrinfo* head() const;
76 76
77 // Constructs an address list for a single socket address.
78 // |address| the sockaddr to copy.
79 // |socket_type| is either SOCK_STREAM or SOCK_DGRAM.
80 // |protocol| is either IPPROTO_TCP or IPPROTO_UDP.
81 static AddressList* CreateAddressListFromSockaddr(
82 const struct sockaddr* address,
83 socklen_t address_length,
84 int socket_type,
85 int protocol);
86
77 private: 87 private:
78 struct Data; 88 struct Data;
79 89
80 explicit AddressList(Data* data); 90 explicit AddressList(Data* data);
81 91
82 scoped_refptr<Data> data_; 92 scoped_refptr<Data> data_;
83 }; 93 };
84 94
85 } // namespace net 95 } // namespace net
86 96
87 #endif // NET_BASE_ADDRESS_LIST_H_ 97 #endif // NET_BASE_ADDRESS_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/address_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698