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

Unified Diff: content/browser/indexed_db/indexed_db_leveldb_coding.cc

Issue 1471073010: Removed unused include of winsock.h/inet.h from sys_byteorder.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include inet.h for things other than byte-swap Created 5 years, 1 month 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 | « components/nacl/browser/nacl_process_host.cc ('k') | net/dns/dns_config_service_posix_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/indexed_db_leveldb_coding.cc
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.cc b/content/browser/indexed_db/indexed_db_leveldb_coding.cc
index 45656a860381510f7277bbfabb0fd687ab9cc4c8..f4d01dec591a6107113f547bc12b80b71d3ccd83 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding.cc
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding.cc
@@ -290,7 +290,7 @@ void EncodeString(const base::string16& value, std::string* into) {
base::char16* dst =
reinterpret_cast<base::char16*>(&*into->begin() + current);
for (unsigned i = 0; i < length; ++i)
- *dst++ = htons(*src++);
+ *dst++ = base::HostToNet16(*src++);
}
void EncodeBinary(const std::string& value, std::string* into) {
@@ -455,7 +455,7 @@ bool DecodeString(StringPiece* slice, base::string16* value) {
const base::char16* encoded =
reinterpret_cast<const base::char16*>(slice->begin());
for (unsigned i = 0; i < length; ++i)
- decoded.push_back(ntohs(*encoded++));
+ decoded.push_back(base::NetToHost16(*encoded++));
*value = decoded;
slice->remove_prefix(length * sizeof(base::char16));
« no previous file with comments | « components/nacl/browser/nacl_process_host.cc ('k') | net/dns/dns_config_service_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698