| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DNS_DNS_RESPONSE_H_ | 5 #ifndef NET_DNS_DNS_RESPONSE_H_ |
| 6 #define NET_DNS_DNS_RESPONSE_H_ | 6 #define NET_DNS_DNS_RESPONSE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 14 #include "base/time.h" |
| 14 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 15 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
| 16 | 17 |
| 17 namespace net { | 18 namespace net { |
| 18 | 19 |
| 20 class AddressList; |
| 19 class DnsQuery; | 21 class DnsQuery; |
| 20 class IOBufferWithSize; | 22 class IOBufferWithSize; |
| 21 | 23 |
| 22 namespace dns_protocol { | 24 namespace dns_protocol { |
| 23 struct Header; | 25 struct Header; |
| 24 } | 26 } |
| 25 | 27 |
| 26 // Parsed resource record. | 28 // Parsed resource record. |
| 27 struct NET_EXPORT_PRIVATE DnsResourceRecord { | 29 struct NET_EXPORT_PRIVATE DnsResourceRecord { |
| 28 DnsResourceRecord(); | 30 DnsResourceRecord(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // Buffer into which response bytes are read. | 125 // Buffer into which response bytes are read. |
| 124 scoped_refptr<IOBufferWithSize> io_buffer_; | 126 scoped_refptr<IOBufferWithSize> io_buffer_; |
| 125 | 127 |
| 126 // Iterator constructed after InitParse positioned at the answer section. | 128 // Iterator constructed after InitParse positioned at the answer section. |
| 127 // It is never updated afterwards, so can be used in accessors. | 129 // It is never updated afterwards, so can be used in accessors. |
| 128 DnsRecordParser parser_; | 130 DnsRecordParser parser_; |
| 129 | 131 |
| 130 DISALLOW_COPY_AND_ASSIGN(DnsResponse); | 132 DISALLOW_COPY_AND_ASSIGN(DnsResponse); |
| 131 }; | 133 }; |
| 132 | 134 |
| 135 // Extracts an AddressList from a DnsResponse. Returns true if succeeded. |
| 136 bool DnsResponseToAddressList(const DnsResponse* response, |
| 137 AddressList* addr_list, |
| 138 base::TimeDelta* ttl); |
| 139 |
| 133 } // namespace net | 140 } // namespace net |
| 134 | 141 |
| 135 #endif // NET_DNS_DNS_RESPONSE_H_ | 142 #endif // NET_DNS_DNS_RESPONSE_H_ |
| OLD | NEW |