| 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 <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const SSLConfig& proxy_ssl_config, | 112 const SSLConfig& proxy_ssl_config, |
| 113 HttpStreamRequest::StreamType stream_type) = 0; | 113 HttpStreamRequest::StreamType stream_type) = 0; |
| 114 | 114 |
| 115 // Invoked to notify the Request and Factory of the readiness of new | 115 // Invoked to notify the Request and Factory of the readiness of new |
| 116 // SPDY session. | 116 // SPDY session. |
| 117 virtual void OnNewSpdySessionReady( | 117 virtual void OnNewSpdySessionReady( |
| 118 Job* job, | 118 Job* job, |
| 119 const base::WeakPtr<SpdySession>& spdy_session, | 119 const base::WeakPtr<SpdySession>& spdy_session, |
| 120 bool direct) = 0; | 120 bool direct) = 0; |
| 121 | 121 |
| 122 // Invoked when the orphaned |job| finishes. |
| 123 virtual void OnOrphanedJobComplete(const Job* job) = 0; |
| 124 |
| 122 // Invoked when the |job| finishes pre-connecting sockets. | 125 // Invoked when the |job| finishes pre-connecting sockets. |
| 123 virtual void OnPreconnectsComplete(Job* job) = 0; | 126 virtual void OnPreconnectsComplete(Job* job) = 0; |
| 124 | 127 |
| 125 // Invoked to record connection attempts made by the socket layer to | 128 // Invoked to record connection attempts made by the socket layer to |
| 126 // Request if |job| is associated with Request. | 129 // Request if |job| is associated with Request. |
| 127 virtual void AddConnectionAttemptsToRequest( | 130 virtual void AddConnectionAttemptsToRequest( |
| 128 Job* job, | 131 Job* job, |
| 129 const ConnectionAttempts& attempts) = 0; | 132 const ConnectionAttempts& attempts) = 0; |
| 130 | 133 |
| 131 // Invoked when |job| finishes initiating a connection. | 134 // Invoked when |job| finishes initiating a connection. |
| 132 virtual void OnConnectionInitialized(Job* job, int rv) = 0; | 135 virtual void OnConnectionInitialized(Job* job, int rv) = 0; |
| 133 | 136 |
| 134 // Return false if |job| can advance to the next state. Otherwise, |job| | 137 // Return false if |job| can advance to the next state. Otherwise, |job| |
| 135 // will wait for Job::Resume() to be called before advancing. | 138 // will wait for Job::Resume() to be called before advancing. |
| 136 virtual bool ShouldWait(Job* job) = 0; | 139 virtual bool ShouldWait(Job* job) = 0; |
| 137 | 140 |
| 138 // Called when |job| determines the appropriate |spdy_session_key| for the | 141 // Called when |job| determines the appropriate |spdy_session_key| for the |
| 139 // Request. Note that this does not mean that SPDY is necessarily supported | 142 // Request. Note that this does not mean that SPDY is necessarily supported |
| 140 // for this SpdySessionKey, since we may need to wait for NPN to complete | 143 // for this SpdySessionKey, since we may need to wait for NPN to complete |
| 141 // before knowing if SPDY is available. | 144 // before knowing if SPDY is available. |
| 142 virtual void SetSpdySessionKey(Job* job, | 145 virtual void SetSpdySessionKey(Job* job, |
| 143 const SpdySessionKey& spdy_session_key) = 0; | 146 const SpdySessionKey& spdy_session_key) = 0; |
| 144 | 147 |
| 145 // Remove session from the SpdySessionRequestMap. | 148 // Remove session from the SpdySessionRequestMap. |
| 146 virtual void RemoveRequestFromSpdySessionRequestMapForJob(Job* job) = 0; | 149 virtual void RemoveRequestFromSpdySessionRequestMapForJob(Job* job) = 0; |
| 147 | 150 |
| 148 virtual const NetLogWithSource* GetNetLog() const = 0; | 151 virtual const NetLogWithSource* GetNetLog(Job* job) const = 0; |
| 149 | 152 |
| 150 virtual WebSocketHandshakeStreamBase::CreateHelper* | 153 virtual WebSocketHandshakeStreamBase::CreateHelper* |
| 151 websocket_handshake_stream_create_helper() = 0; | 154 websocket_handshake_stream_create_helper() = 0; |
| 152 | 155 |
| 153 virtual void MaybeSetWaitTimeForMainJob(const base::TimeDelta& delay) = 0; | 156 virtual void MaybeSetWaitTimeForMainJob(const base::TimeDelta& delay) = 0; |
| 154 | 157 |
| 155 virtual bool for_websockets() = 0; | 158 virtual bool for_websockets() = 0; |
| 156 }; | 159 }; |
| 157 | 160 |
| 158 // Constructor for non-alternative Job. | 161 // Constructor for non-alternative Job. |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 const SSLConfig& proxy_ssl_config, | 532 const SSLConfig& proxy_ssl_config, |
| 530 HostPortPair destination, | 533 HostPortPair destination, |
| 531 GURL origin_url, | 534 GURL origin_url, |
| 532 bool enable_ip_based_pooling, | 535 bool enable_ip_based_pooling, |
| 533 NetLog* net_log) = 0; | 536 NetLog* net_log) = 0; |
| 534 }; | 537 }; |
| 535 | 538 |
| 536 } // namespace net | 539 } // namespace net |
| 537 | 540 |
| 538 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 541 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| OLD | NEW |