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

Unified Diff: crypto/symmetric_key_win.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 | « crypto/p224.cc ('k') | jingle/notifier/base/chrome_async_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/symmetric_key_win.cc
diff --git a/crypto/symmetric_key_win.cc b/crypto/symmetric_key_win.cc
index 87e0bc3a4597f66b8d9bc1956b52cebf53916774..f4cd751992d2ef86dea27e928f495c0d9b53c094 100644
--- a/crypto/symmetric_key_win.cc
+++ b/crypto/symmetric_key_win.cc
@@ -4,12 +4,11 @@
#include "crypto/symmetric_key.h"
-#include <winsock2.h> // For htonl.
-
#include <vector>
// TODO(wtc): replace scoped_array by std::vector.
#include "base/memory/scoped_ptr.h"
+#include "base/sys_byteorder.h"
namespace crypto {
@@ -264,7 +263,7 @@ bool ComputePBKDF2Block(HCRYPTHASH hash,
return false;
// Iteration U_1: and append (big-endian) INT (i).
- uint32 big_endian_block_index = htonl(block_index);
+ uint32 big_endian_block_index = base::HostToNet32(block_index);
ok = CryptHashData(safe_hash,
reinterpret_cast<BYTE*>(&big_endian_block_index),
sizeof(big_endian_block_index), 0);
« no previous file with comments | « crypto/p224.cc ('k') | jingle/notifier/base/chrome_async_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698