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

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

Issue 8801004: base::Bind: Convert StreamSocket::Connect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 9 years 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/socks5_client_socket.cc ('k') | net/socket/socks_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_SOCKS_CLIENT_SOCKET_H_ 5 #ifndef NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ 6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 const HostResolver::RequestInfo& req_info, 42 const HostResolver::RequestInfo& req_info,
43 HostResolver* host_resolver); 43 HostResolver* host_resolver);
44 44
45 // On destruction Disconnect() is called. 45 // On destruction Disconnect() is called.
46 virtual ~SOCKSClientSocket(); 46 virtual ~SOCKSClientSocket();
47 47
48 // StreamSocket methods: 48 // StreamSocket methods:
49 49
50 // Does the SOCKS handshake and completes the protocol. 50 // Does the SOCKS handshake and completes the protocol.
51 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; 51 virtual int Connect(OldCompletionCallback* callback) OVERRIDE;
52 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
52 virtual void Disconnect() OVERRIDE; 53 virtual void Disconnect() OVERRIDE;
53 virtual bool IsConnected() const OVERRIDE; 54 virtual bool IsConnected() const OVERRIDE;
54 virtual bool IsConnectedAndIdle() const OVERRIDE; 55 virtual bool IsConnectedAndIdle() const OVERRIDE;
55 virtual const BoundNetLog& NetLog() const OVERRIDE; 56 virtual const BoundNetLog& NetLog() const OVERRIDE;
56 virtual void SetSubresourceSpeculation() OVERRIDE; 57 virtual void SetSubresourceSpeculation() OVERRIDE;
57 virtual void SetOmniboxSpeculation() OVERRIDE; 58 virtual void SetOmniboxSpeculation() OVERRIDE;
58 virtual bool WasEverUsed() const OVERRIDE; 59 virtual bool WasEverUsed() const OVERRIDE;
59 virtual bool UsingTCPFastOpen() const OVERRIDE; 60 virtual bool UsingTCPFastOpen() const OVERRIDE;
60 virtual int64 NumBytesRead() const OVERRIDE; 61 virtual int64 NumBytesRead() const OVERRIDE;
61 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; 62 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 const std::string BuildHandshakeWriteBuffer() const; 104 const std::string BuildHandshakeWriteBuffer() const;
104 105
105 OldCompletionCallbackImpl<SOCKSClientSocket> io_callback_; 106 OldCompletionCallbackImpl<SOCKSClientSocket> io_callback_;
106 107
107 // Stores the underlying socket. 108 // Stores the underlying socket.
108 scoped_ptr<ClientSocketHandle> transport_; 109 scoped_ptr<ClientSocketHandle> transport_;
109 110
110 State next_state_; 111 State next_state_;
111 112
112 // Stores the callback to the layer above, called on completing Connect(). 113 // Stores the callback to the layer above, called on completing Connect().
113 OldCompletionCallback* user_callback_; 114 OldCompletionCallback* old_user_callback_;
115 CompletionCallback user_callback_;
114 116
115 // This IOBuffer is used by the class to read and write 117 // This IOBuffer is used by the class to read and write
116 // SOCKS handshake data. The length contains the expected size to 118 // SOCKS handshake data. The length contains the expected size to
117 // read or write. 119 // read or write.
118 scoped_refptr<IOBuffer> handshake_buf_; 120 scoped_refptr<IOBuffer> handshake_buf_;
119 121
120 // While writing, this buffer stores the complete write handshake data. 122 // While writing, this buffer stores the complete write handshake data.
121 // While reading, it stores the handshake information received so far. 123 // While reading, it stores the handshake information received so far.
122 std::string buffer_; 124 std::string buffer_;
123 125
(...skipping 11 matching lines...) Expand all
135 HostResolver::RequestInfo host_request_info_; 137 HostResolver::RequestInfo host_request_info_;
136 138
137 BoundNetLog net_log_; 139 BoundNetLog net_log_;
138 140
139 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocket); 141 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocket);
140 }; 142 };
141 143
142 } // namespace net 144 } // namespace net
143 145
144 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_H_ 146 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_H_
OLDNEW
« no previous file with comments | « net/socket/socks5_client_socket.cc ('k') | net/socket/socks_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698