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_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_H_ |
6 #define NET_HTTP_HTTP_STREAM_FACTORY_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
15 #include "net/base/load_states.h" | 15 #include "net/base/load_states.h" |
16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
17 #include "net/base/request_priority.h" | 17 #include "net/base/request_priority.h" |
| 18 #include "net/http/bidirectional_stream_job.h" |
18 #include "net/http/http_server_properties.h" | 19 #include "net/http/http_server_properties.h" |
19 #include "net/socket/connection_attempts.h" | 20 #include "net/socket/connection_attempts.h" |
20 #include "net/ssl/ssl_failure_state.h" | 21 #include "net/ssl/ssl_failure_state.h" |
21 // This file can be included from net/http even though | 22 // This file can be included from net/http even though |
22 // it is in net/websockets because it doesn't | 23 // it is in net/websockets because it doesn't |
23 // introduce any link dependency to net/websockets. | 24 // introduce any link dependency to net/websockets. |
24 #include "net/websockets/websocket_handshake_stream_base.h" | 25 #include "net/websockets/websocket_handshake_stream_base.h" |
25 | 26 |
26 class GURL; | 27 class GURL; |
27 | 28 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // |used_ssl_config| indicates the actual SSL configuration used for this | 78 // |used_ssl_config| indicates the actual SSL configuration used for this |
78 // stream, since the HttpStreamRequest may have modified the configuration | 79 // stream, since the HttpStreamRequest may have modified the configuration |
79 // during stream processing. | 80 // during stream processing. |
80 // |used_proxy_info| indicates the actual ProxyInfo used for this stream, | 81 // |used_proxy_info| indicates the actual ProxyInfo used for this stream, |
81 // since the HttpStreamRequest performs the proxy resolution. | 82 // since the HttpStreamRequest performs the proxy resolution. |
82 virtual void OnWebSocketHandshakeStreamReady( | 83 virtual void OnWebSocketHandshakeStreamReady( |
83 const SSLConfig& used_ssl_config, | 84 const SSLConfig& used_ssl_config, |
84 const ProxyInfo& used_proxy_info, | 85 const ProxyInfo& used_proxy_info, |
85 WebSocketHandshakeStreamBase* stream) = 0; | 86 WebSocketHandshakeStreamBase* stream) = 0; |
86 | 87 |
| 88 virtual void OnBidirectionalStreamJobReady( |
| 89 const SSLConfig& used_ssl_config, |
| 90 const ProxyInfo& used_proxy_info, |
| 91 BidirectionalStreamJob* stream) = 0; |
| 92 |
87 // This is the failure to create a stream case. | 93 // This is the failure to create a stream case. |
88 // |used_ssl_config| indicates the actual SSL configuration used for this | 94 // |used_ssl_config| indicates the actual SSL configuration used for this |
89 // stream, since the HttpStreamRequest may have modified the configuration | 95 // stream, since the HttpStreamRequest may have modified the configuration |
90 // during stream processing. If an SSL handshake failed, |ssl_failure_state| | 96 // during stream processing. If an SSL handshake failed, |ssl_failure_state| |
91 // is the state the SSLClientSocket was in. | 97 // is the state the SSLClientSocket was in. |
92 virtual void OnStreamFailed(int status, | 98 virtual void OnStreamFailed(int status, |
93 const SSLConfig& used_ssl_config, | 99 const SSLConfig& used_ssl_config, |
94 SSLFailureState ssl_failure_state) = 0; | 100 SSLFailureState ssl_failure_state) = 0; |
95 | 101 |
96 // Called when we have a certificate error for the request. | 102 // Called when we have a certificate error for the request. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // completion. | 225 // completion. |
220 virtual HttpStreamRequest* RequestWebSocketHandshakeStream( | 226 virtual HttpStreamRequest* RequestWebSocketHandshakeStream( |
221 const HttpRequestInfo& info, | 227 const HttpRequestInfo& info, |
222 RequestPriority priority, | 228 RequestPriority priority, |
223 const SSLConfig& server_ssl_config, | 229 const SSLConfig& server_ssl_config, |
224 const SSLConfig& proxy_ssl_config, | 230 const SSLConfig& proxy_ssl_config, |
225 HttpStreamRequest::Delegate* delegate, | 231 HttpStreamRequest::Delegate* delegate, |
226 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 232 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
227 const BoundNetLog& net_log) = 0; | 233 const BoundNetLog& net_log) = 0; |
228 | 234 |
| 235 // Request a BidirectionalStreamJob. |
| 236 // Will call delegate->OnBidirectionalStreamJobReady on successful |
| 237 // completion. |
| 238 virtual HttpStreamRequest* RequestBidirectionalStreamJob( |
| 239 const HttpRequestInfo& info, |
| 240 RequestPriority priority, |
| 241 const SSLConfig& server_ssl_config, |
| 242 const SSLConfig& proxy_ssl_config, |
| 243 HttpStreamRequest::Delegate* delegate, |
| 244 const BoundNetLog& net_log) = 0; |
| 245 |
229 // Requests that enough connections for |num_streams| be opened. | 246 // Requests that enough connections for |num_streams| be opened. |
230 virtual void PreconnectStreams(int num_streams, | 247 virtual void PreconnectStreams(int num_streams, |
231 const HttpRequestInfo& info, | 248 const HttpRequestInfo& info, |
232 const SSLConfig& server_ssl_config, | 249 const SSLConfig& server_ssl_config, |
233 const SSLConfig& proxy_ssl_config) = 0; | 250 const SSLConfig& proxy_ssl_config) = 0; |
234 | 251 |
235 virtual const HostMappingRules* GetHostMappingRules() const = 0; | 252 virtual const HostMappingRules* GetHostMappingRules() const = 0; |
236 | 253 |
237 // Static settings | 254 // Static settings |
238 | 255 |
(...skipping 15 matching lines...) Expand all Loading... |
254 static bool spdy_enabled_; | 271 static bool spdy_enabled_; |
255 | 272 |
256 HostPortPair RewriteHost(HostPortPair host_port_pair); | 273 HostPortPair RewriteHost(HostPortPair host_port_pair); |
257 | 274 |
258 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); | 275 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); |
259 }; | 276 }; |
260 | 277 |
261 } // namespace net | 278 } // namespace net |
262 | 279 |
263 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ | 280 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ |
OLD | NEW |