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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 const int kSOCKS5GreetResponseLength = arraysize(kSOCKS5GreetResponse); 2031 const int kSOCKS5GreetResponseLength = arraysize(kSOCKS5GreetResponse);
2032 2032
2033 const char kSOCKS5OkRequest[] = 2033 const char kSOCKS5OkRequest[] =
2034 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; 2034 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 };
2035 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); 2035 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest);
2036 2036
2037 const char kSOCKS5OkResponse[] = 2037 const char kSOCKS5OkResponse[] =
2038 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; 2038 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
2039 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); 2039 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
2040 2040
2041 int64_t CountReadBytes(const MockRead reads[], size_t reads_size) {
2042 int64_t total = 0;
2043 for (const MockRead* read = reads; read != reads + reads_size; ++read)
2044 total += read->data_len;
2045 return total;
2046 }
2047
2048 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) {
2049 int64_t total = 0;
2050 for (const MockWrite* write = writes; write != writes + writes_size; ++write)
2051 total += write->data_len;
2052 return total;
2053 }
2054
2041 } // namespace net 2055 } // namespace net
OLDNEW
« 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