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

Unified Diff: content/browser/renderer_host/p2p/socket_host_test_utils.h

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 | « content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc ('k') | crypto/encryptor.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_test_utils.h
diff --git a/content/browser/renderer_host/p2p/socket_host_test_utils.h b/content/browser/renderer_host/p2p/socket_host_test_utils.h
index 6c3113ba3dec17ff8a1ff4a83589dfd5b47e325c..18ec833621fc6473b0db13f9a3d7a9ea075a6cfa 100644
--- a/content/browser/renderer_host/p2p/socket_host_test_utils.h
+++ b/content/browser/renderer_host/p2p/socket_host_test_utils.h
@@ -232,10 +232,11 @@ void CreateRandomPacket(std::vector<char>* packet) {
void CreateStunPacket(std::vector<char>* packet, uint16 type) {
CreateRandomPacket(packet);
- *reinterpret_cast<uint16*>(&*packet->begin()) = htons(type);
+ *reinterpret_cast<uint16*>(&*packet->begin()) = base::HostToNet16(type);
*reinterpret_cast<uint16*>(&*packet->begin() + 2) =
- htons(packet->size() - kStunHeaderSize);
- *reinterpret_cast<uint32*>(&*packet->begin() + 4) = htonl(kStunMagicCookie);
+ base::HostToNet16(packet->size() - kStunHeaderSize);
+ *reinterpret_cast<uint32*>(&*packet->begin() + 4) =
+ base::HostToNet32(kStunMagicCookie);
}
void CreateStunRequest(std::vector<char>* packet) {
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc ('k') | crypto/encryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698