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

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

Issue 9401014: fake_dns tool for Android. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: 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
===================================================================
--- tools/android/common/net.cc (revision 122317)
+++ tools/android/common/net.cc (working copy)
@@ -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 @@
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