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

Side by Side Diff: net/socket/socks5_client_socket.h

Issue 169643006: Use sockets with unread data if they've never been used before. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mmenke comments Created 6 years, 9 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/client_socket_pool_base_unittest.cc ('k') | net/socket/socks5_client_socket.cc » ('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 #ifndef NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ 5 #ifndef NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_
6 #define NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ 6 #define NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 static const unsigned int kGreetReadHeaderSize; 93 static const unsigned int kGreetReadHeaderSize;
94 static const unsigned int kWriteHeaderSize; 94 static const unsigned int kWriteHeaderSize;
95 static const unsigned int kReadHeaderSize; 95 static const unsigned int kReadHeaderSize;
96 static const uint8 kSOCKS5Version; 96 static const uint8 kSOCKS5Version;
97 static const uint8 kTunnelCommand; 97 static const uint8 kTunnelCommand;
98 static const uint8 kNullByte; 98 static const uint8 kNullByte;
99 99
100 void DoCallback(int result); 100 void DoCallback(int result);
101 void OnIOComplete(int result); 101 void OnIOComplete(int result);
102 void OnReadWriteComplete(const CompletionCallback& callback, int result);
102 103
103 int DoLoop(int last_io_result); 104 int DoLoop(int last_io_result);
104 int DoHandshakeRead(); 105 int DoHandshakeRead();
105 int DoHandshakeReadComplete(int result); 106 int DoHandshakeReadComplete(int result);
106 int DoHandshakeWrite(); 107 int DoHandshakeWrite();
107 int DoHandshakeWriteComplete(int result); 108 int DoHandshakeWriteComplete(int result);
108 int DoGreetRead(); 109 int DoGreetRead();
109 int DoGreetReadComplete(int result); 110 int DoGreetReadComplete(int result);
110 int DoGreetWrite(); 111 int DoGreetWrite();
111 int DoGreetWriteComplete(int result); 112 int DoGreetWriteComplete(int result);
(...skipping 24 matching lines...) Expand all
136 // This becomes true when the SOCKS handshake has completed and the 137 // This becomes true when the SOCKS handshake has completed and the
137 // overlying connection is free to communicate. 138 // overlying connection is free to communicate.
138 bool completed_handshake_; 139 bool completed_handshake_;
139 140
140 // These contain the bytes sent / received by the SOCKS handshake. 141 // These contain the bytes sent / received by the SOCKS handshake.
141 size_t bytes_sent_; 142 size_t bytes_sent_;
142 size_t bytes_received_; 143 size_t bytes_received_;
143 144
144 size_t read_header_size; 145 size_t read_header_size;
145 146
147 bool was_ever_used_;
148
146 HostResolver::RequestInfo host_request_info_; 149 HostResolver::RequestInfo host_request_info_;
147 150
148 BoundNetLog net_log_; 151 BoundNetLog net_log_;
149 152
150 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket); 153 DISALLOW_COPY_AND_ASSIGN(SOCKS5ClientSocket);
151 }; 154 };
152 155
153 } // namespace net 156 } // namespace net
154 157
155 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_ 158 #endif // NET_SOCKET_SOCKS5_CLIENT_SOCKET_H_
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | net/socket/socks5_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698