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

Unified Diff: tools/android/common/net.cc

Issue 9419020: fake_dns tool for Android (fixed DEPS). (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Try to remove references of fake_dns.gyp from all_android.gyp Created 8 years, 10 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 | « tools/android/common/net.h ('k') | tools/android/fake_dns/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/common/net.cc
diff --git a/tools/android/common/net.cc b/tools/android/common/net.cc
index e50a18a9a45ad55414ba4deefde9fbf9c2d9a3f1..12bca8e787aabdecdc2d81547bf4ca7c465f1d4c 100644
--- a/tools/android/common/net.cc
+++ b/tools/android/common/net.cc
@@ -9,6 +9,8 @@
#include <sys/socket.h>
#include <sys/types.h>
+#include "base/stringprintf.h"
+
namespace tools {
int DisableNagle(int socket) {
@@ -21,5 +23,18 @@ int DeferAccept(int socket) {
return setsockopt(socket, IPPROTO_TCP, TCP_DEFER_ACCEPT, &on, sizeof(on));
}
+std::string DumpBinary(const char* buffer, size_t length) {
+ std::string result = "[";
+ for (int i = 0; i < length; ++i) {
+ base::StringAppendF(&result, "%02x,",
+ static_cast<unsigned char>(buffer[i]));
+ }
+
+ if (length)
+ result.erase(result.length() - 1);
+
+ return result + "]";
+}
+
} // namespace tools
« no previous file with comments | « tools/android/common/net.h ('k') | tools/android/fake_dns/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698