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

Side by Side Diff: net/socket/socket_test_util.cc

Issue 10704166: Change DeterministicMockTCPClientSocket to set the peer address from the connect data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sleevi's comment Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/socket_test_util.h ('k') | no next file » | 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 DeterministicMockTCPClientSocket::DeterministicMockTCPClientSocket( 935 DeterministicMockTCPClientSocket::DeterministicMockTCPClientSocket(
936 net::NetLog* net_log, DeterministicSocketData* data) 936 net::NetLog* net_log, DeterministicSocketData* data)
937 : MockClientSocket(net_log), 937 : MockClientSocket(net_log),
938 write_pending_(false), 938 write_pending_(false),
939 write_result_(0), 939 write_result_(0),
940 read_data_(), 940 read_data_(),
941 read_buf_(NULL), 941 read_buf_(NULL),
942 read_buf_len_(0), 942 read_buf_len_(0),
943 read_pending_(false), 943 read_pending_(false),
944 data_(data), 944 data_(data),
945 was_used_to_convey_data_(false) {} 945 was_used_to_convey_data_(false) {
946 peer_addr_ = data->connect_data().peer_addr;
947 }
946 948
947 DeterministicMockTCPClientSocket::~DeterministicMockTCPClientSocket() {} 949 DeterministicMockTCPClientSocket::~DeterministicMockTCPClientSocket() {}
948 950
949 void DeterministicMockTCPClientSocket::CompleteWrite() { 951 void DeterministicMockTCPClientSocket::CompleteWrite() {
950 was_used_to_convey_data_ = true; 952 was_used_to_convey_data_ = true;
951 write_pending_ = false; 953 write_pending_ = false;
952 write_callback_.Run(write_result_); 954 write_callback_.Run(write_result_);
953 } 955 }
954 956
955 int DeterministicMockTCPClientSocket::CompleteRead() { 957 int DeterministicMockTCPClientSocket::CompleteRead() {
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 1643
1642 const char kSOCKS5OkRequest[] = 1644 const char kSOCKS5OkRequest[] =
1643 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; 1645 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 };
1644 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); 1646 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest);
1645 1647
1646 const char kSOCKS5OkResponse[] = 1648 const char kSOCKS5OkResponse[] =
1647 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; 1649 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
1648 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); 1650 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
1649 1651
1650 } // namespace net 1652 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698