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

Side by Side Diff: net/dns/dns_query.h

Issue 1352233002: Returning scoped_ptr<> instead of raw pointer in DnsQuery::CloneWithNewId (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | net/dns/dns_query.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) 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_QUERY_H_ 5 #ifndef NET_DNS_DNS_QUERY_H_
6 #define NET_DNS_DNS_QUERY_H_ 6 #define NET_DNS_DNS_QUERY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_piece.h" 11 #include "base/strings/string_piece.h"
11 #include "net/base/net_export.h" 12 #include "net/base/net_export.h"
12 13
13 namespace net { 14 namespace net {
14 15
15 class IOBufferWithSize; 16 class IOBufferWithSize;
16 17
17 // Represents on-the-wire DNS query message as an object. 18 // Represents on-the-wire DNS query message as an object.
18 // TODO(szym): add support for the OPT pseudo-RR (EDNS0/DNSSEC). 19 // TODO(szym): add support for the OPT pseudo-RR (EDNS0/DNSSEC).
19 class NET_EXPORT_PRIVATE DnsQuery { 20 class NET_EXPORT_PRIVATE DnsQuery {
20 public: 21 public:
21 // Constructs a query message from |qname| which *MUST* be in a valid 22 // Constructs a query message from |qname| which *MUST* be in a valid
22 // DNS name format, and |qtype|. The qclass is set to IN. 23 // DNS name format, and |qtype|. The qclass is set to IN.
23 DnsQuery(uint16 id, const base::StringPiece& qname, uint16 qtype); 24 DnsQuery(uint16 id, const base::StringPiece& qname, uint16 qtype);
24 ~DnsQuery(); 25 ~DnsQuery();
25 26
26 // Clones |this| verbatim, with ID field of the header set to |id|. 27 // Clones |this| verbatim, with ID field of the header set to |id|.
27 DnsQuery* CloneWithNewId(uint16 id) const; 28 scoped_ptr<DnsQuery> CloneWithNewId(uint16 id) const;
28 29
29 // DnsQuery field accessors. 30 // DnsQuery field accessors.
30 uint16 id() const; 31 uint16 id() const;
31 base::StringPiece qname() const; 32 base::StringPiece qname() const;
32 uint16 qtype() const; 33 uint16 qtype() const;
33 34
34 // Returns the Question section of the query. Used when matching the 35 // Returns the Question section of the query. Used when matching the
35 // response. 36 // response.
36 base::StringPiece question() const; 37 base::StringPiece question() const;
37 38
(...skipping 11 matching lines...) Expand all
49 50
50 // Contains query bytes to be consumed by higher level Write() call. 51 // Contains query bytes to be consumed by higher level Write() call.
51 scoped_refptr<IOBufferWithSize> io_buffer_; 52 scoped_refptr<IOBufferWithSize> io_buffer_;
52 53
53 DISALLOW_COPY_AND_ASSIGN(DnsQuery); 54 DISALLOW_COPY_AND_ASSIGN(DnsQuery);
54 }; 55 };
55 56
56 } // namespace net 57 } // namespace net
57 58
58 #endif // NET_DNS_DNS_QUERY_H_ 59 #endif // NET_DNS_DNS_QUERY_H_
OLDNEW
« no previous file with comments | « no previous file | net/dns/dns_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698