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