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

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

Issue 7008021: Added DnsQuery class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get rid of unnecessary include 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
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 a response object with an IOBuffer large enough to read
20 // every possible; |query| is a pointer to the DnsQuery for which |this|
21 // is supposed to be a response.
22 explicit DnsResponse(DnsQuery* query);
23
24 // Internal buffer accessor into which actual bytes of response to be
cbentzel 2011/06/02 21:27:13 bytes of response are to be read. Why don't call
agayev 2011/06/02 22:33:26 Moving it outside this class will break the symmet
25 // read.
26 IOBufferWithSize* io_buffer() { return io_buffer_.get(); }
27
28 // Parses response of size nbytes and puts address into |results|,
29 // returns net_error code in case of failure.
30 int Parse(int nbytes, AddressList* results);
31
32 private:
33 // The matching query; |this| is the response for |query_|. We do not
34 // own it, lifetime of |this| should be within the limits of lifetime of
35 // |query_|.
36 DnsQuery* const query_;
cbentzel 2011/06/02 21:27:13 This can be const DnsQuery* const query_;
agayev 2011/06/02 22:33:26 Done.
37
38 // Buffer into which response bytes are read.
39 scoped_refptr<IOBufferWithSize> io_buffer_;
40
41 DISALLOW_COPY_AND_ASSIGN(DnsResponse);
42 };
43
44 } // namespace net
45
46 #endif // NET_BASE_DNS_RESPONSE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698