| 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_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Used to detach the Job from |request|. | 79 // Used to detach the Job from |request|. |
| 80 void Orphan(const Request* request); | 80 void Orphan(const Request* request); |
| 81 | 81 |
| 82 void SetPriority(RequestPriority priority); | 82 void SetPriority(RequestPriority priority); |
| 83 | 83 |
| 84 RequestPriority priority() const { return priority_; } | 84 RequestPriority priority() const { return priority_; } |
| 85 bool was_npn_negotiated() const; | 85 bool was_npn_negotiated() const; |
| 86 NextProto protocol_negotiated() const; | 86 NextProto protocol_negotiated() const; |
| 87 bool using_spdy() const; | 87 bool using_spdy() const; |
| 88 const BoundNetLog& net_log() const { return net_log_; } | 88 const BoundNetLog& net_log() const { return net_log_; } |
| 89 bool for_bidirectional() const { return for_bidirectional_; } |
| 89 | 90 |
| 90 const SSLConfig& server_ssl_config() const; | 91 const SSLConfig& server_ssl_config() const; |
| 91 const SSLConfig& proxy_ssl_config() const; | 92 const SSLConfig& proxy_ssl_config() const; |
| 92 const ProxyInfo& proxy_info() const; | 93 const ProxyInfo& proxy_info() const; |
| 93 | 94 |
| 94 // Indicates whether or not this job is performing a preconnect. | 95 // Indicates whether or not this job is performing a preconnect. |
| 95 bool IsPreconnecting() const; | 96 bool IsPreconnecting() const; |
| 96 | 97 |
| 97 // Indicates whether or not this Job has been orphaned by a Request. | 98 // Indicates whether or not this Job has been orphaned by a Request. |
| 98 bool IsOrphaned() const; | 99 bool IsOrphaned() const; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // Returns appropriate error code otherwise. | 188 // Returns appropriate error code otherwise. |
| 188 int CheckAlternativeServiceValidityForOrigin( | 189 int CheckAlternativeServiceValidityForOrigin( |
| 189 base::WeakPtr<SpdySession> spdy_session); | 190 base::WeakPtr<SpdySession> spdy_session); |
| 190 | 191 |
| 191 SpdySessionPool* const spdy_session_pool_; | 192 SpdySessionPool* const spdy_session_pool_; |
| 192 const GURL origin_url_; | 193 const GURL origin_url_; |
| 193 const bool is_spdy_alternative_; | 194 const bool is_spdy_alternative_; |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 void OnStreamReadyCallback(); | 197 void OnStreamReadyCallback(); |
| 198 void OnBidirectionalStreamReadyCallback(); |
| 197 void OnWebSocketHandshakeStreamReadyCallback(); | 199 void OnWebSocketHandshakeStreamReadyCallback(); |
| 198 // This callback function is called when a new SPDY session is created. | 200 // This callback function is called when a new SPDY session is created. |
| 199 void OnNewSpdySessionReadyCallback(); | 201 void OnNewSpdySessionReadyCallback(); |
| 200 void OnStreamFailedCallback(int result); | 202 void OnStreamFailedCallback(int result); |
| 201 void OnCertificateErrorCallback(int result, const SSLInfo& ssl_info); | 203 void OnCertificateErrorCallback(int result, const SSLInfo& ssl_info); |
| 202 void OnNeedsProxyAuthCallback(const HttpResponseInfo& response_info, | 204 void OnNeedsProxyAuthCallback(const HttpResponseInfo& response_info, |
| 203 HttpAuthController* auth_controller); | 205 HttpAuthController* auth_controller); |
| 204 void OnNeedsClientAuthCallback(SSLCertRequestInfo* cert_info); | 206 void OnNeedsClientAuthCallback(SSLCertRequestInfo* cert_info); |
| 205 void OnHttpsProxyTunnelResponseCallback(const HttpResponseInfo& response_info, | 207 void OnHttpsProxyTunnelResponseCallback(const HttpResponseInfo& response_info, |
| 206 HttpStream* stream); | 208 HttpStream* stream); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 363 |
| 362 scoped_refptr<HttpAuthController> | 364 scoped_refptr<HttpAuthController> |
| 363 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS]; | 365 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS]; |
| 364 | 366 |
| 365 // True when the tunnel is in the process of being established - we can't | 367 // True when the tunnel is in the process of being established - we can't |
| 366 // read from the socket until the tunnel is done. | 368 // read from the socket until the tunnel is done. |
| 367 bool establishing_tunnel_; | 369 bool establishing_tunnel_; |
| 368 | 370 |
| 369 scoped_ptr<HttpStream> stream_; | 371 scoped_ptr<HttpStream> stream_; |
| 370 scoped_ptr<WebSocketHandshakeStreamBase> websocket_stream_; | 372 scoped_ptr<WebSocketHandshakeStreamBase> websocket_stream_; |
| 373 scoped_ptr<BidirectionalStream> bidirectional_stream_; |
| 371 | 374 |
| 372 // True if we negotiated NPN. | 375 // True if we negotiated NPN. |
| 373 bool was_npn_negotiated_; | 376 bool was_npn_negotiated_; |
| 374 | 377 |
| 375 // Protocol negotiated with the server. | 378 // Protocol negotiated with the server. |
| 376 NextProto protocol_negotiated_; | 379 NextProto protocol_negotiated_; |
| 377 | 380 |
| 378 // 0 if we're not preconnecting. Otherwise, the number of streams to | 381 // 0 if we're not preconnecting. Otherwise, the number of streams to |
| 379 // preconnect. | 382 // preconnect. |
| 380 int num_streams_; | 383 int num_streams_; |
| 381 | 384 |
| 382 scoped_ptr<ValidSpdySessionPool> valid_spdy_session_pool_; | 385 scoped_ptr<ValidSpdySessionPool> valid_spdy_session_pool_; |
| 383 | 386 |
| 384 // Initialized when we create a new SpdySession. | 387 // Initialized when we create a new SpdySession. |
| 385 base::WeakPtr<SpdySession> new_spdy_session_; | 388 base::WeakPtr<SpdySession> new_spdy_session_; |
| 386 | 389 |
| 387 // Initialized when we have an existing SpdySession. | 390 // Initialized when we have an existing SpdySession. |
| 388 base::WeakPtr<SpdySession> existing_spdy_session_; | 391 base::WeakPtr<SpdySession> existing_spdy_session_; |
| 389 | 392 |
| 390 // Only used if |new_spdy_session_| is non-NULL. | 393 // Only used if |new_spdy_session_| is non-NULL. |
| 391 bool spdy_session_direct_; | 394 bool spdy_session_direct_; |
| 392 | 395 |
| 393 JobStatus job_status_; | 396 JobStatus job_status_; |
| 394 JobStatus other_job_status_; | 397 JobStatus other_job_status_; |
| 395 | 398 |
| 399 // True if BidirectionalStream is requested. |
| 400 bool for_bidirectional_; |
| 401 |
| 396 base::WeakPtrFactory<Job> ptr_factory_; | 402 base::WeakPtrFactory<Job> ptr_factory_; |
| 397 | 403 |
| 398 DISALLOW_COPY_AND_ASSIGN(Job); | 404 DISALLOW_COPY_AND_ASSIGN(Job); |
| 399 }; | 405 }; |
| 400 | 406 |
| 401 } // namespace net | 407 } // namespace net |
| 402 | 408 |
| 403 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 409 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| OLD | NEW |