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

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

Issue 8949026: Move net/base/sys_byteorder.h to base/sys_byteorder.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Denitting, rebase Created 8 years, 12 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/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/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
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 #include "net/dns/dns_query.h" 5 #include "net/dns/dns_query.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/sys_byteorder.h"
9 #include "net/base/big_endian.h" 10 #include "net/base/big_endian.h"
10 #include "net/base/dns_util.h" 11 #include "net/base/dns_util.h"
11 #include "net/base/io_buffer.h" 12 #include "net/base/io_buffer.h"
12 #include "net/base/sys_byteorder.h"
13 #include "net/dns/dns_protocol.h" 13 #include "net/dns/dns_protocol.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 // DNS query consists of a 12-byte header followed by a question section. 17 // DNS query consists of a 12-byte header followed by a question section.
18 // For details, see RFC 1035 section 4.1.1. This header template sets RD 18 // For details, see RFC 1035 section 4.1.1. This header template sets RD
19 // bit, which directs the name server to pursue query recursively, and sets 19 // bit, which directs the name server to pursue query recursively, and sets
20 // the QDCOUNT to 1, meaning the question section has a single entry. 20 // the QDCOUNT to 1, meaning the question section has a single entry.
21 DnsQuery::DnsQuery(uint16 id, const base::StringPiece& qname, uint16 qtype) 21 DnsQuery::DnsQuery(uint16 id, const base::StringPiece& qname, uint16 qtype)
22 : qname_size_(qname.size()) { 22 : qname_size_(qname.size()) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 qname_size_ = orig.qname_size_; 74 qname_size_ = orig.qname_size_;
75 io_buffer_ = new IOBufferWithSize(orig.io_buffer()->size()); 75 io_buffer_ = new IOBufferWithSize(orig.io_buffer()->size());
76 memcpy(io_buffer_.get()->data(), orig.io_buffer()->data(), 76 memcpy(io_buffer_.get()->data(), orig.io_buffer()->data(),
77 io_buffer_.get()->size()); 77 io_buffer_.get()->size());
78 dns_protocol::Header* header = 78 dns_protocol::Header* header =
79 reinterpret_cast<dns_protocol::Header*>(io_buffer_->data()); 79 reinterpret_cast<dns_protocol::Header*>(io_buffer_->data());
80 header->id = htons(id); 80 header->id = htons(id);
81 } 81 }
82 82
83 } // namespace net 83 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/dns_response.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698