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

Unified Diff: crypto/encryptor.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 | « content/browser/renderer_host/p2p/socket_host_test_utils.h ('k') | crypto/p224.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/encryptor.cc
diff --git a/crypto/encryptor.cc b/crypto/encryptor.cc
index 31a7cc830a45d0c4a65de0bfe65262437270793e..1c8dcf5c743714d19e3b9aa5543491e1673f2d35 100644
--- a/crypto/encryptor.cc
+++ b/crypto/encryptor.cc
@@ -21,14 +21,14 @@ Encryptor::Counter::~Counter() {
}
bool Encryptor::Counter::Increment() {
- uint64 low_num = base::ntohll(counter_.components64[1]);
+ uint64 low_num = base::NetToHost64(counter_.components64[1]);
uint64 new_low_num = low_num + 1;
- counter_.components64[1] = base::htonll(new_low_num);
+ counter_.components64[1] = base::HostToNet64(new_low_num);
// If overflow occured then increment the most significant component.
if (new_low_num < low_num) {
counter_.components64[0] =
- base::htonll(base::ntohll(counter_.components64[0]) + 1);
+ base::HostToNet64(base::NetToHost64(counter_.components64[0]) + 1);
}
// TODO(hclam): Return false if counter value overflows.
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_test_utils.h ('k') | crypto/p224.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698