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

Unified Diff: content/browser/renderer_host/p2p/socket_host.cc

Issue 9716020: Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 9 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 | « chrome/common/metrics/metrics_log_base.cc ('k') | content/browser/renderer_host/p2p/socket_host_tcp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/p2p/socket_host.cc
diff --git a/content/browser/renderer_host/p2p/socket_host.cc b/content/browser/renderer_host/p2p/socket_host.cc
index 0f071278458882294dff172e6a337e692ea34a90..575ce38c35e90c882b0cbe9ff1669263997356d8 100644
--- a/content/browser/renderer_host/p2p/socket_host.cc
+++ b/content/browser/renderer_host/p2p/socket_host.cc
@@ -34,15 +34,15 @@ bool P2PSocketHost::GetStunPacketType(
if (data_size < kStunHeaderSize)
return false;
- uint32 cookie = ntohl(*reinterpret_cast<const uint32*>(data + 4));
+ uint32 cookie = base::NetToHost32(*reinterpret_cast<const uint32*>(data + 4));
if (cookie != kStunMagicCookie)
return false;
- uint16 length = ntohs(*reinterpret_cast<const uint16*>(data + 2));
+ uint16 length = base::NetToHost16(*reinterpret_cast<const uint16*>(data + 2));
if (length != data_size - kStunHeaderSize)
return false;
- int message_type = ntohs(*reinterpret_cast<const uint16*>(data));
+ int message_type = base::NetToHost16(*reinterpret_cast<const uint16*>(data));
// Verify that the type is known:
switch (message_type) {
« no previous file with comments | « chrome/common/metrics/metrics_log_base.cc ('k') | content/browser/renderer_host/p2p/socket_host_tcp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698