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

Unified Diff: net/spdy/spdy_framer.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_reader_test.cc ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 3dff08f6f07beb6208c3d843c07d18d7ce5e147b..cd12aaca34d8c74bcea2e63d549e8695b8fb3b14 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -139,7 +139,8 @@ SettingsFlagsAndId SettingsFlagsAndId::FromWireFormat(
if (version < SPDY3) {
ConvertFlagsAndIdForSpdy2(&wire);
}
- return SettingsFlagsAndId(ntohl(wire) >> 24, ntohl(wire) & 0x00ffffff);
+ return SettingsFlagsAndId(base::NetToHost32(wire) >> 24,
+ base::NetToHost32(wire) & 0x00ffffff);
}
SettingsFlagsAndId::SettingsFlagsAndId(uint8 flags, uint32 id)
@@ -149,7 +150,8 @@ SettingsFlagsAndId::SettingsFlagsAndId(uint8 flags, uint32 id)
uint32 SettingsFlagsAndId::GetWireFormat(SpdyMajorVersion version)
const {
- uint32 wire = htonl(id_ & 0x00ffffff) | htonl(flags_ << 24);
+ uint32 wire =
+ base::HostToNet32(id_ & 0x00ffffff) | base::HostToNet32(flags_ << 24);
if (version < SPDY3) {
ConvertFlagsAndIdForSpdy2(&wire);
}
@@ -1801,10 +1803,10 @@ bool SpdyFramer::ProcessSetting(const char* data) {
SettingsFlagsAndId::FromWireFormat(protocol_version(), id_and_flags_wire);
id_field = id_and_flags.id();
flags = id_and_flags.flags();
- value = ntohl(*(reinterpret_cast<const uint32*>(data + 4)));
+ value = base::NetToHost32(*(reinterpret_cast<const uint32*>(data + 4)));
} else {
- id_field = ntohs(*(reinterpret_cast<const uint16*>(data)));
- value = ntohl(*(reinterpret_cast<const uint32*>(data + 2)));
+ id_field = base::NetToHost16(*(reinterpret_cast<const uint16*>(data)));
+ value = base::NetToHost32(*(reinterpret_cast<const uint32*>(data + 2)));
}
// Validate id.
« no previous file with comments | « net/spdy/spdy_frame_reader_test.cc ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698