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

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

Issue 7056050: Revert 87809 - Added DnsQuery class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « net/base/dns_query_unittest.cc ('k') | net/base/dns_response.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_BASE_DNS_RESPONSE_H_
6 #define NET_BASE_DNS_RESPONSE_H_
7 #pragma once
8
9 #include "net/base/dns_query.h"
10
11 namespace net{
12
13 class AddressList;
14
15 // A class that encapsulates bits and pieces related to DNS response
16 // processing.
17 class DnsResponse {
18 public:
19 // Constructs an object with an IOBuffer large enough to read
20 // one byte more than largest possible response, to detect malformed
21 // responses; |query| is a pointer to the DnsQuery for which |this|
22 // is supposed to be a response.
23 explicit DnsResponse(DnsQuery* query);
24
25 // Internal buffer accessor into which actual bytes of response will be
26 // read.
27 IOBufferWithSize* io_buffer() { return io_buffer_.get(); }
28
29 // Parses response of size nbytes and puts address into |results|,
30 // returns net_error code in case of failure.
31 int Parse(int nbytes, AddressList* results);
32
33 private:
34 // The matching query; |this| is the response for |query_|. We do not
35 // own it, lifetime of |this| should be within the limits of lifetime of
36 // |query_|.
37 const DnsQuery* const query_;
38
39 // Buffer into which response bytes are read.
40 scoped_refptr<IOBufferWithSize> io_buffer_;
41
42 DISALLOW_COPY_AND_ASSIGN(DnsResponse);
43 };
44
45 } // namespace net
46
47 #endif // NET_BASE_DNS_RESPONSE_H_
OLDNEW
« no previous file with comments | « net/base/dns_query_unittest.cc ('k') | net/base/dns_response.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698