Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; | |
|
Ryan Sleevi
2012/07/11 21:34:14
protected members make me sad. Took me much too lo
Ryan Hamilton
2012/07/11 21:51:14
Done, I think. Would you mind taking a look to co
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |