OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "net/base/net_api.h" | 10 #include "net/base/net_export.h" |
11 #include "net/base/net_util.h" | 11 #include "net/base/net_util.h" |
12 | 12 |
13 namespace net{ | 13 namespace net{ |
14 | 14 |
15 class DnsQuery; | 15 class DnsQuery; |
16 class IOBufferWithSize; | 16 class IOBufferWithSize; |
17 | 17 |
18 // Represents on-the-wire DNS response as an object; allows extracting | 18 // Represents on-the-wire DNS response as an object; allows extracting |
19 // records. | 19 // records. |
20 class NET_TEST DnsResponse { | 20 class NET_EXPORT_PRIVATE DnsResponse { |
21 public: | 21 public: |
22 // Constructs an object with an IOBuffer large enough to read | 22 // Constructs an object with an IOBuffer large enough to read |
23 // one byte more than largest possible response, to detect malformed | 23 // one byte more than largest possible response, to detect malformed |
24 // responses; |query| is a pointer to the DnsQuery for which |this| | 24 // responses; |query| is a pointer to the DnsQuery for which |this| |
25 // is supposed to be a response. | 25 // is supposed to be a response. |
26 explicit DnsResponse(DnsQuery* query); | 26 explicit DnsResponse(DnsQuery* query); |
27 ~DnsResponse(); | 27 ~DnsResponse(); |
28 | 28 |
29 // Internal buffer accessor into which actual bytes of response will be | 29 // Internal buffer accessor into which actual bytes of response will be |
30 // read. | 30 // read. |
(...skipping 11 matching lines...) Expand all Loading... |
42 | 42 |
43 // Buffer into which response bytes are read. | 43 // Buffer into which response bytes are read. |
44 scoped_refptr<IOBufferWithSize> io_buffer_; | 44 scoped_refptr<IOBufferWithSize> io_buffer_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(DnsResponse); | 46 DISALLOW_COPY_AND_ASSIGN(DnsResponse); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace net | 49 } // namespace net |
50 | 50 |
51 #endif // NET_DNS_DNS_RESPONSE_H_ | 51 #endif // NET_DNS_DNS_RESPONSE_H_ |
OLD | NEW |