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

Unified Diff: net/socket/socket_test_util.cc

Issue 1314783007: Added and implemented HttpStream::GetTotalSentBytes for basic streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on master Created 5 years, 3 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 | « net/socket/socket_test_util.h ('k') | net/spdy/spdy_http_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 98bf32235ec3e6a38eb2b3c2e1457bb9e88080c1..1d5da044c677264ed09c2743f17a76b71f6e22f3 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -2038,4 +2038,18 @@ const char kSOCKS5OkResponse[] =
{ 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
+int64_t CountReadBytes(const MockRead reads[], size_t reads_size) {
+ int64_t total = 0;
+ for (const MockRead* read = reads; read != reads + reads_size; ++read)
+ total += read->data_len;
+ return total;
+}
+
+int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) {
+ int64_t total = 0;
+ for (const MockWrite* write = writes; write != writes + writes_size; ++write)
+ total += write->data_len;
+ return total;
+}
+
} // namespace net
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/spdy/spdy_http_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698