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 #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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "net/base/address_list.h" | 16 #include "net/base/address_list.h" |
| 17 #include "net/base/completion_callback.h" | 17 #include "net/base/completion_callback.h" |
| 18 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
| 19 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
| 20 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
| 21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 22 #include "net/base/ssl_config_service.h" | 22 #include "net/base/ssl_config_service.h" |
| 23 #include "net/http/http_auth.h" | 23 #include "net/http/http_auth.h" |
| 24 #include "net/http/http_auth_cache.h" | 24 #include "net/http/http_auth_cache.h" |
| 25 #include "net/http/http_auth_handler.h" | 25 #include "net/http/http_auth_handler.h" |
| 26 #include "net/proxy/proxy_service.h" | 26 #include "net/proxy/proxy_service.h" |
| 27 #include "net/socket/tcp_client_socket.h" | 27 #include "net/socket/tcp_client_socket.h" |
| 28 #include "net/url_request/url_request.h" | |
| 28 #include "net/url_request/url_request_context.h" | 29 #include "net/url_request/url_request_context.h" |
| 29 | 30 |
| 30 namespace net { | 31 namespace net { |
| 31 | 32 |
| 32 class AuthChallengeInfo; | 33 class AuthChallengeInfo; |
| 33 class ClientSocketFactory; | 34 class ClientSocketFactory; |
| 34 class CookieOptions; | 35 class CookieOptions; |
| 35 class HostResolver; | 36 class HostResolver; |
| 36 class HttpAuthHandlerFactory; | 37 class HttpAuthHandlerFactory; |
| 37 class SSLConfigService; | 38 class SSLConfigService; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 void Realloc(size_t new_size); | 225 void Realloc(size_t new_size); |
| 225 | 226 |
| 226 private: | 227 private: |
| 227 virtual ~ResponseHeaders(); | 228 virtual ~ResponseHeaders(); |
| 228 | 229 |
| 229 scoped_ptr_malloc<char> headers_; | 230 scoped_ptr_malloc<char> headers_; |
| 230 }; | 231 }; |
| 231 | 232 |
| 232 enum State { | 233 enum State { |
| 233 STATE_NONE, | 234 STATE_NONE, |
| 235 STATE_BEFORE_CONNECT, | |
| 234 STATE_RESOLVE_PROXY, | 236 STATE_RESOLVE_PROXY, |
| 235 STATE_RESOLVE_PROXY_COMPLETE, | 237 STATE_RESOLVE_PROXY_COMPLETE, |
| 236 STATE_RESOLVE_HOST, | 238 STATE_RESOLVE_HOST, |
| 237 STATE_RESOLVE_HOST_COMPLETE, | 239 STATE_RESOLVE_HOST_COMPLETE, |
| 238 STATE_RESOLVE_PROTOCOL, | 240 STATE_RESOLVE_PROTOCOL, |
| 239 STATE_RESOLVE_PROTOCOL_COMPLETE, | 241 STATE_RESOLVE_PROTOCOL_COMPLETE, |
| 240 STATE_TCP_CONNECT, | 242 STATE_TCP_CONNECT, |
| 241 STATE_TCP_CONNECT_COMPLETE, | 243 STATE_TCP_CONNECT_COMPLETE, |
| 242 STATE_WRITE_TUNNEL_HEADERS, | 244 STATE_WRITE_TUNNEL_HEADERS, |
| 243 STATE_WRITE_TUNNEL_HEADERS_COMPLETE, | 245 STATE_WRITE_TUNNEL_HEADERS_COMPLETE, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 int DidEstablishConnection(); | 282 int DidEstablishConnection(); |
| 281 int DidReceiveData(int result); | 283 int DidReceiveData(int result); |
| 282 int DidSendData(int result); | 284 int DidSendData(int result); |
| 283 | 285 |
| 284 void OnIOCompleted(int result); | 286 void OnIOCompleted(int result); |
| 285 void OnReadCompleted(int result); | 287 void OnReadCompleted(int result); |
| 286 void OnWriteCompleted(int result); | 288 void OnWriteCompleted(int result); |
| 287 | 289 |
| 288 void DoLoop(int result); | 290 void DoLoop(int result); |
| 289 | 291 |
| 292 int DoBeforeConnect(); | |
| 290 int DoResolveProxy(); | 293 int DoResolveProxy(); |
| 291 int DoResolveProxyComplete(int result); | 294 int DoResolveProxyComplete(int result); |
| 292 int DoResolveHost(); | 295 int DoResolveHost(); |
| 293 int DoResolveHostComplete(int result); | 296 int DoResolveHostComplete(int result); |
| 294 int DoResolveProtocol(int result); | 297 int DoResolveProtocol(int result); |
| 295 int DoResolveProtocolComplete(int result); | 298 int DoResolveProtocolComplete(int result); |
| 296 int DoTcpConnect(int result); | 299 int DoTcpConnect(int result); |
| 297 int DoTcpConnectComplete(int result); | 300 int DoTcpConnectComplete(int result); |
| 298 int DoWriteTunnelHeaders(); | 301 int DoWriteTunnelHeaders(); |
| 299 int DoWriteTunnelHeadersComplete(int result); | 302 int DoWriteTunnelHeadersComplete(int result); |
| 300 int DoReadTunnelHeaders(); | 303 int DoReadTunnelHeaders(); |
| 301 int DoReadTunnelHeadersComplete(int result); | 304 int DoReadTunnelHeadersComplete(int result); |
| 302 int DoSOCKSConnect(); | 305 int DoSOCKSConnect(); |
| 303 int DoSOCKSConnectComplete(int result); | 306 int DoSOCKSConnectComplete(int result); |
| 304 int DoSecureProxyConnect(); | 307 int DoSecureProxyConnect(); |
| 305 int DoSecureProxyConnectComplete(int result); | 308 int DoSecureProxyConnectComplete(int result); |
| 306 int DoSecureProxyHandleCertError(int result); | 309 int DoSecureProxyHandleCertError(int result); |
| 307 int DoSecureProxyHandleCertErrorComplete(int result); | 310 int DoSecureProxyHandleCertErrorComplete(int result); |
| 308 int DoSSLConnect(); | 311 int DoSSLConnect(); |
| 309 int DoSSLConnectComplete(int result); | 312 int DoSSLConnectComplete(int result); |
| 310 int DoSSLHandleCertError(int result); | 313 int DoSSLHandleCertError(int result); |
| 311 int DoSSLHandleCertErrorComplete(int result); | 314 int DoSSLHandleCertErrorComplete(int result); |
| 312 int DoReadWrite(int result); | 315 int DoReadWrite(int result); |
| 313 | 316 |
| 317 void BeforeConnectComplete(int result); | |
|
willchan no longer on Chromium
2012/06/07 23:07:07
Please follow the existing convention. Pass the io
bashi
2012/06/08 02:48:33
Done.
| |
| 318 | |
| 314 GURL ProxyAuthOrigin() const; | 319 GURL ProxyAuthOrigin() const; |
| 315 int HandleAuthChallenge(const HttpResponseHeaders* headers); | 320 int HandleAuthChallenge(const HttpResponseHeaders* headers); |
| 316 int HandleCertificateRequest(int result); | 321 int HandleCertificateRequest(int result); |
| 317 void DoAuthRequired(); | 322 void DoAuthRequired(); |
| 318 void DoRestartWithAuth(); | 323 void DoRestartWithAuth(); |
| 319 | 324 |
| 320 int HandleCertificateError(int result); | 325 int HandleCertificateError(int result); |
| 321 int AllowCertErrorForReconnection(SSLConfig* ssl_config); | 326 int AllowCertErrorForReconnection(SSLConfig* ssl_config); |
| 322 | 327 |
| 323 SSLConfigService* ssl_config_service() const; | 328 SSLConfigService* ssl_config_service() const; |
| 324 ProxyService* proxy_service() const; | 329 ProxyService* proxy_service() const; |
| 325 | 330 |
| 326 BoundNetLog net_log_; | 331 BoundNetLog net_log_; |
| 327 | 332 |
| 328 GURL url_; | 333 GURL url_; |
| 329 int max_pending_send_allowed_; | 334 int max_pending_send_allowed_; |
| 330 const URLRequestContext* context_; | 335 const URLRequestContext* context_; |
| 331 | 336 |
| 332 UserDataMap user_data_; | 337 UserDataMap user_data_; |
| 333 | 338 |
| 334 State next_state_; | 339 State next_state_; |
| 335 HostResolver* host_resolver_; | 340 HostResolver* host_resolver_; |
| 336 CertVerifier* cert_verifier_; | 341 CertVerifier* cert_verifier_; |
| 337 ServerBoundCertService* server_bound_cert_service_; | 342 ServerBoundCertService* server_bound_cert_service_; |
| 338 HttpAuthHandlerFactory* http_auth_handler_factory_; | 343 HttpAuthHandlerFactory* http_auth_handler_factory_; |
| 339 ClientSocketFactory* factory_; | 344 ClientSocketFactory* factory_; |
| 340 | 345 |
| 346 CompletionCallback before_connect_callback_; | |
| 347 | |
| 341 ProxyMode proxy_mode_; | 348 ProxyMode proxy_mode_; |
| 342 | 349 |
| 343 GURL proxy_url_; | 350 GURL proxy_url_; |
| 344 ProxyService::PacRequest* pac_request_; | 351 ProxyService::PacRequest* pac_request_; |
| 345 ProxyInfo proxy_info_; | 352 ProxyInfo proxy_info_; |
| 346 | 353 |
| 347 HttpAuthCache auth_cache_; | 354 HttpAuthCache auth_cache_; |
| 348 scoped_ptr<HttpAuthHandler> auth_handler_; | 355 scoped_ptr<HttpAuthHandler> auth_handler_; |
| 349 HttpAuth::Identity auth_identity_; | 356 HttpAuth::Identity auth_identity_; |
| 350 scoped_refptr<AuthChallengeInfo> auth_info_; | 357 scoped_refptr<AuthChallengeInfo> auth_info_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 383 bool server_closed_; | 390 bool server_closed_; |
| 384 | 391 |
| 385 scoped_ptr<SocketStreamMetrics> metrics_; | 392 scoped_ptr<SocketStreamMetrics> metrics_; |
| 386 | 393 |
| 387 DISALLOW_COPY_AND_ASSIGN(SocketStream); | 394 DISALLOW_COPY_AND_ASSIGN(SocketStream); |
| 388 }; | 395 }; |
| 389 | 396 |
| 390 } // namespace net | 397 } // namespace net |
| 391 | 398 |
| 392 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ | 399 #endif // NET_SOCKET_STREAM_SOCKET_STREAM_H_ |
| OLD | NEW |