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/basictypes.h" | 11 #include "base/basictypes.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.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 OnBidirectionalStreamReady(const SSLConfig& used_ssl_config, | |
89 const ProxyInfo& used_proxy_info, | |
90 BidirectionalStream* stream) = 0; | |
91 | |
87 // This is the failure to create a stream case. | 92 // This is the failure to create a stream case. |
88 // |used_ssl_config| indicates the actual SSL configuration used for this | 93 // |used_ssl_config| indicates the actual SSL configuration used for this |
89 // stream, since the HttpStreamRequest may have modified the configuration | 94 // stream, since the HttpStreamRequest may have modified the configuration |
90 // during stream processing. If an SSL handshake failed, |ssl_failure_state| | 95 // during stream processing. If an SSL handshake failed, |ssl_failure_state| |
91 // is the state the SSLClientSocket was in. | 96 // is the state the SSLClientSocket was in. |
92 virtual void OnStreamFailed(int status, | 97 virtual void OnStreamFailed(int status, |
93 const SSLConfig& used_ssl_config, | 98 const SSLConfig& used_ssl_config, |
94 SSLFailureState ssl_failure_state) = 0; | 99 SSLFailureState ssl_failure_state) = 0; |
95 | 100 |
96 // Called when we have a certificate error for the request. | 101 // Called when we have a certificate error for the request. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 // completion. | 220 // completion. |
216 virtual HttpStreamRequest* RequestWebSocketHandshakeStream( | 221 virtual HttpStreamRequest* RequestWebSocketHandshakeStream( |
217 const HttpRequestInfo& info, | 222 const HttpRequestInfo& info, |
218 RequestPriority priority, | 223 RequestPriority priority, |
219 const SSLConfig& server_ssl_config, | 224 const SSLConfig& server_ssl_config, |
220 const SSLConfig& proxy_ssl_config, | 225 const SSLConfig& proxy_ssl_config, |
221 HttpStreamRequest::Delegate* delegate, | 226 HttpStreamRequest::Delegate* delegate, |
222 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 227 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
223 const BoundNetLog& net_log) = 0; | 228 const BoundNetLog& net_log) = 0; |
224 | 229 |
230 // Will call delegate->OnBidirectionalStreamReady on successful | |
231 // completion. | |
232 virtual HttpStreamRequest* RequestBidirectionalStream( | |
233 const HttpRequestInfo& info, | |
234 RequestPriority priority, | |
235 const SSLConfig& server_ssl_config, | |
236 const SSLConfig& proxy_ssl_config, | |
237 HttpStreamRequest::Delegate* delegate, | |
238 const BoundNetLog& net_log) = 0; | |
mmenke
2015/10/07 18:43:33
Unlike the two above methods, BidirectionalStreams
xunjieli
2015/10/19 21:07:46
Talked to Matt offline on this. I added a wrapper
| |
239 | |
225 // Requests that enough connections for |num_streams| be opened. | 240 // Requests that enough connections for |num_streams| be opened. |
226 virtual void PreconnectStreams(int num_streams, | 241 virtual void PreconnectStreams(int num_streams, |
227 const HttpRequestInfo& info, | 242 const HttpRequestInfo& info, |
228 const SSLConfig& server_ssl_config, | 243 const SSLConfig& server_ssl_config, |
229 const SSLConfig& proxy_ssl_config) = 0; | 244 const SSLConfig& proxy_ssl_config) = 0; |
230 | 245 |
231 virtual const HostMappingRules* GetHostMappingRules() const = 0; | 246 virtual const HostMappingRules* GetHostMappingRules() const = 0; |
232 | 247 |
233 // Static settings | 248 // Static settings |
234 | 249 |
(...skipping 15 matching lines...) Expand all Loading... | |
250 static bool spdy_enabled_; | 265 static bool spdy_enabled_; |
251 | 266 |
252 HostPortPair RewriteHost(HostPortPair host_port_pair); | 267 HostPortPair RewriteHost(HostPortPair host_port_pair); |
253 | 268 |
254 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); | 269 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory); |
255 }; | 270 }; |
256 | 271 |
257 } // namespace net | 272 } // namespace net |
258 | 273 |
259 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ | 274 #endif // NET_HTTP_HTTP_STREAM_FACTORY_H_ |
OLD | NEW |