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

Unified Diff: net/dns/dns_query.cc

Issue 145873006: ui/base/resource: Roll our own version of ReadBigEndian() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/big_endian_unittest.cc ('k') | net/dns/dns_response.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_query.cc
diff --git a/net/dns/dns_query.cc b/net/dns/dns_query.cc
index 270757e7be9c9038cf165670f2e8686e9c91e3aa..530508a61de1b3f051e5f7139aeef16ca3cce0bd 100644
--- a/net/dns/dns_query.cc
+++ b/net/dns/dns_query.cc
@@ -6,8 +6,8 @@
#include <limits>
+#include "base/big_endian.h"
#include "base/sys_byteorder.h"
-#include "net/base/big_endian.h"
#include "net/base/dns_util.h"
#include "net/base/io_buffer.h"
#include "net/dns/dns_protocol.h"
@@ -33,7 +33,8 @@ DnsQuery::DnsQuery(uint16 id, const base::StringPiece& qname, uint16 qtype)
header->qdcount = base::HostToNet16(1);
// Write question section after the header.
- BigEndianWriter writer(reinterpret_cast<char*>(header + 1), question_size);
+ base::BigEndianWriter writer(reinterpret_cast<char*>(header + 1),
+ question_size);
writer.WriteBytes(qname.data(), qname.size());
writer.WriteU16(qtype);
writer.WriteU16(dns_protocol::kClassIN);
@@ -59,9 +60,8 @@ base::StringPiece DnsQuery::qname() const {
uint16 DnsQuery::qtype() const {
uint16 type;
- ReadBigEndian<uint16>(io_buffer_->data() +
- sizeof(dns_protocol::Header) +
- qname_size_, &type);
+ base::ReadBigEndian<uint16>(
+ io_buffer_->data() + sizeof(dns_protocol::Header) + qname_size_, &type);
return type;
}
« no previous file with comments | « net/base/big_endian_unittest.cc ('k') | net/dns/dns_response.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698