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

Unified Diff: net/spdy/spdy_frame_reader.cc

Issue 1471073010: Removed unused include of winsock.h/inet.h from sys_byteorder.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include inet.h for things other than byte-swap Created 5 years, 1 month 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/spdy/spdy_frame_builder.cc ('k') | net/spdy/spdy_frame_reader_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_frame_reader.cc
diff --git a/net/spdy/spdy_frame_reader.cc b/net/spdy/spdy_frame_reader.cc
index 3ecce43e17e511d000aaaec6a35a819b37055dcb..be972ec5552851699f49a1e570a4e17119a15134 100644
--- a/net/spdy/spdy_frame_reader.cc
+++ b/net/spdy/spdy_frame_reader.cc
@@ -40,7 +40,7 @@ bool SpdyFrameReader::ReadUInt16(uint16* result) {
}
// Read into result.
- *result = ntohs(*(reinterpret_cast<const uint16*>(data_ + ofs_)));
+ *result = base::NetToHost16(*(reinterpret_cast<const uint16*>(data_ + ofs_)));
// Iterate.
ofs_ += 2;
@@ -56,7 +56,7 @@ bool SpdyFrameReader::ReadUInt32(uint32* result) {
}
// Read into result.
- *result = ntohl(*(reinterpret_cast<const uint32*>(data_ + ofs_)));
+ *result = base::NetToHost32(*(reinterpret_cast<const uint32*>(data_ + ofs_)));
// Iterate.
ofs_ += 4;
@@ -72,8 +72,10 @@ bool SpdyFrameReader::ReadUInt64(uint64* result) {
}
// Read into result. Network byte order is big-endian.
- uint64 upper = ntohl(*(reinterpret_cast<const uint32*>(data_ + ofs_)));
- uint64 lower = ntohl(*(reinterpret_cast<const uint32*>(data_ + ofs_ + 4)));
+ uint64 upper =
+ base::NetToHost32(*(reinterpret_cast<const uint32*>(data_ + ofs_)));
+ uint64 lower =
+ base::NetToHost32(*(reinterpret_cast<const uint32*>(data_ + ofs_ + 4)));
*result = (upper << 32) + lower;
// Iterate.
@@ -103,7 +105,7 @@ bool SpdyFrameReader::ReadUInt24(uint32* result) {
// Read into result.
*result = 0;
memcpy(reinterpret_cast<char*>(result) + 1, data_ + ofs_, 3);
- *result = ntohl(*result);
+ *result = base::NetToHost32(*result);
// Iterate.
ofs_ += 3;
« no previous file with comments | « net/spdy/spdy_frame_builder.cc ('k') | net/spdy/spdy_frame_reader_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698