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

Unified Diff: sync/util/nigori.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 | « ppapi/shared_impl/private/net_address_private_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/util/nigori.cc
diff --git a/sync/util/nigori.cc b/sync/util/nigori.cc
index 168d8eb5ec6e02866e331630ebe9b45de1ed9449..af694a114331a33f0252870ab42bc9aa7e88094d 100644
--- a/sync/util/nigori.cc
+++ b/sync/util/nigori.cc
@@ -30,7 +30,7 @@ class NigoriStream {
// Append the big-endian representation of the length of |value| with 32 bits,
// followed by |value| itself to the stream.
NigoriStream& operator<<(const std::string& value) {
- uint32 size = htonl(value.size());
+ uint32 size = base::HostToNet32(value.size());
stream_.write((char *) &size, sizeof(uint32));
stream_ << value;
return *this;
@@ -40,9 +40,9 @@ class NigoriStream {
// followed by the big-endian representation of the value of |type|, with 32
// bits, to the stream.
NigoriStream& operator<<(const Nigori::Type type) {
- uint32 size = htonl(sizeof(uint32));
+ uint32 size = base::HostToNet32(sizeof(uint32));
stream_.write((char *) &size, sizeof(uint32));
- uint32 value = htonl(type);
+ uint32 value = base::HostToNet32(type);
stream_.write((char *) &value, sizeof(uint32));
return *this;
}
« no previous file with comments | « ppapi/shared_impl/private/net_address_private_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698