OLD | NEW |
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_STREAM_SOCKET_STREAM_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 STATE_RESOLVE_PROTOCOL, | 221 STATE_RESOLVE_PROTOCOL, |
222 STATE_RESOLVE_PROTOCOL_COMPLETE, | 222 STATE_RESOLVE_PROTOCOL_COMPLETE, |
223 STATE_TCP_CONNECT, | 223 STATE_TCP_CONNECT, |
224 STATE_TCP_CONNECT_COMPLETE, | 224 STATE_TCP_CONNECT_COMPLETE, |
225 STATE_WRITE_TUNNEL_HEADERS, | 225 STATE_WRITE_TUNNEL_HEADERS, |
226 STATE_WRITE_TUNNEL_HEADERS_COMPLETE, | 226 STATE_WRITE_TUNNEL_HEADERS_COMPLETE, |
227 STATE_READ_TUNNEL_HEADERS, | 227 STATE_READ_TUNNEL_HEADERS, |
228 STATE_READ_TUNNEL_HEADERS_COMPLETE, | 228 STATE_READ_TUNNEL_HEADERS_COMPLETE, |
229 STATE_SOCKS_CONNECT, | 229 STATE_SOCKS_CONNECT, |
230 STATE_SOCKS_CONNECT_COMPLETE, | 230 STATE_SOCKS_CONNECT_COMPLETE, |
| 231 STATE_SECURE_PROXY_CONNECT, |
| 232 STATE_SECURE_PROXY_CONNECT_COMPLETE, |
231 STATE_SSL_CONNECT, | 233 STATE_SSL_CONNECT, |
232 STATE_SSL_CONNECT_COMPLETE, | 234 STATE_SSL_CONNECT_COMPLETE, |
233 STATE_READ_WRITE, | 235 STATE_READ_WRITE, |
234 STATE_AUTH_REQUIRED, | 236 STATE_AUTH_REQUIRED, |
235 STATE_CLOSE, | 237 STATE_CLOSE, |
236 }; | 238 }; |
237 | 239 |
238 enum ProxyMode { | 240 enum ProxyMode { |
239 kDirectConnection, // If using a direct connection | 241 kDirectConnection, // If using a direct connection |
240 kTunnelProxy, // If using a tunnel (CONNECT method as HTTPS) | 242 kTunnelProxy, // If using a tunnel (CONNECT method as HTTPS) |
241 kSOCKSProxy, // If using a SOCKS proxy | 243 kSOCKSProxy, // If using a SOCKS proxy |
242 }; | 244 }; |
243 | 245 |
244 // Use the same number as HttpNetworkTransaction::kMaxHeaderBufSize. | 246 // Use the same number as HttpNetworkTransaction::kMaxHeaderBufSize. |
245 enum { kMaxTunnelResponseHeadersSize = 32768 }; // 32 kilobytes. | 247 enum { kMaxTunnelResponseHeadersSize = 32768 }; // 32 kilobytes. |
246 | 248 |
247 // Copies the given addrinfo list in |addresses_|. | 249 // Copies the given addrinfo list in |addresses_|. |
248 // Used for WebSocketThrottleTest. | 250 // Used for WebSocketThrottleTest. |
249 void CopyAddrInfo(struct addrinfo* head); | 251 void CopyAddrInfo(struct addrinfo* head); |
250 | 252 |
251 void DoClose(); | 253 void DoClose(); |
252 | 254 |
253 // Finishes the job. | 255 // Finishes the job. |
254 // Calls OnError and OnClose of delegate, and no more | 256 // Calls OnError and OnClose of delegate, and no more |
255 // notifications will be sent to delegate. | 257 // notifications will be sent to delegate. |
256 void Finish(int result); | 258 void Finish(int result); |
257 | 259 |
| 260 int DidEstablishSSL(int result); |
258 int DidEstablishConnection(); | 261 int DidEstablishConnection(); |
259 int DidReceiveData(int result); | 262 int DidReceiveData(int result); |
260 int DidSendData(int result); | 263 int DidSendData(int result); |
261 | 264 |
262 void OnIOCompleted(int result); | 265 void OnIOCompleted(int result); |
263 void OnReadCompleted(int result); | 266 void OnReadCompleted(int result); |
264 void OnWriteCompleted(int result); | 267 void OnWriteCompleted(int result); |
265 | 268 |
266 void DoLoop(int result); | 269 void DoLoop(int result); |
267 | 270 |
268 int DoResolveProxy(); | 271 int DoResolveProxy(); |
269 int DoResolveProxyComplete(int result); | 272 int DoResolveProxyComplete(int result); |
270 int DoResolveHost(); | 273 int DoResolveHost(); |
271 int DoResolveHostComplete(int result); | 274 int DoResolveHostComplete(int result); |
272 int DoResolveProtocol(int result); | 275 int DoResolveProtocol(int result); |
273 int DoResolveProtocolComplete(int result); | 276 int DoResolveProtocolComplete(int result); |
274 int DoTcpConnect(int result); | 277 int DoTcpConnect(int result); |
275 int DoTcpConnectComplete(int result); | 278 int DoTcpConnectComplete(int result); |
276 int DoWriteTunnelHeaders(); | 279 int DoWriteTunnelHeaders(); |
277 int DoWriteTunnelHeadersComplete(int result); | 280 int DoWriteTunnelHeadersComplete(int result); |
278 int DoReadTunnelHeaders(); | 281 int DoReadTunnelHeaders(); |
279 int DoReadTunnelHeadersComplete(int result); | 282 int DoReadTunnelHeadersComplete(int result); |
280 int DoSOCKSConnect(); | 283 int DoSOCKSConnect(); |
281 int DoSOCKSConnectComplete(int result); | 284 int DoSOCKSConnectComplete(int result); |
| 285 int DoSecureProxyConnect(); |
| 286 int DoSecureProxyConnectComplete(int result); |
282 int DoSSLConnect(); | 287 int DoSSLConnect(); |
283 int DoSSLConnectComplete(int result); | 288 int DoSSLConnectComplete(int result); |
284 int DoReadWrite(int result); | 289 int DoReadWrite(int result); |
285 | 290 |
286 GURL ProxyAuthOrigin() const; | 291 GURL ProxyAuthOrigin() const; |
287 int HandleAuthChallenge(const HttpResponseHeaders* headers); | 292 int HandleAuthChallenge(const HttpResponseHeaders* headers); |
288 void DoAuthRequired(); | 293 void DoAuthRequired(); |
289 void DoRestartWithAuth(); | 294 void DoRestartWithAuth(); |
290 | 295 |
291 int HandleCertificateError(int result); | 296 int HandleCertificateError(int result); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 bool server_closed_; | 358 bool server_closed_; |
354 | 359 |
355 scoped_ptr<SocketStreamMetrics> metrics_; | 360 scoped_ptr<SocketStreamMetrics> metrics_; |
356 | 361 |
357 DISALLOW_COPY_AND_ASSIGN(SocketStream); | 362 DISALLOW_COPY_AND_ASSIGN(SocketStream); |
358 }; | 363 }; |
359 | 364 |
360 } // namespace net | 365 } // namespace net |
361 | 366 |
362 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 367 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
OLD | NEW |