| 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_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
| 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // is true. | 37 // is true. |
| 38 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); | 38 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); |
| 39 ~HttpStreamFactoryImpl() override; | 39 ~HttpStreamFactoryImpl() override; |
| 40 | 40 |
| 41 // HttpStreamFactory interface | 41 // HttpStreamFactory interface |
| 42 HttpStreamRequest* RequestStream(const HttpRequestInfo& info, | 42 HttpStreamRequest* RequestStream(const HttpRequestInfo& info, |
| 43 RequestPriority priority, | 43 RequestPriority priority, |
| 44 const SSLConfig& server_ssl_config, | 44 const SSLConfig& server_ssl_config, |
| 45 const SSLConfig& proxy_ssl_config, | 45 const SSLConfig& proxy_ssl_config, |
| 46 HttpStreamRequest::Delegate* delegate, | 46 HttpStreamRequest::Delegate* delegate, |
| 47 const BoundNetLog& net_log) override; | 47 const NetLogWithSource& net_log) override; |
| 48 | 48 |
| 49 HttpStreamRequest* RequestWebSocketHandshakeStream( | 49 HttpStreamRequest* RequestWebSocketHandshakeStream( |
| 50 const HttpRequestInfo& info, | 50 const HttpRequestInfo& info, |
| 51 RequestPriority priority, | 51 RequestPriority priority, |
| 52 const SSLConfig& server_ssl_config, | 52 const SSLConfig& server_ssl_config, |
| 53 const SSLConfig& proxy_ssl_config, | 53 const SSLConfig& proxy_ssl_config, |
| 54 HttpStreamRequest::Delegate* delegate, | 54 HttpStreamRequest::Delegate* delegate, |
| 55 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 55 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
| 56 const BoundNetLog& net_log) override; | 56 const NetLogWithSource& net_log) override; |
| 57 | 57 |
| 58 HttpStreamRequest* RequestBidirectionalStreamImpl( | 58 HttpStreamRequest* RequestBidirectionalStreamImpl( |
| 59 const HttpRequestInfo& info, | 59 const HttpRequestInfo& info, |
| 60 RequestPriority priority, | 60 RequestPriority priority, |
| 61 const SSLConfig& server_ssl_config, | 61 const SSLConfig& server_ssl_config, |
| 62 const SSLConfig& proxy_ssl_config, | 62 const SSLConfig& proxy_ssl_config, |
| 63 HttpStreamRequest::Delegate* delegate, | 63 HttpStreamRequest::Delegate* delegate, |
| 64 const BoundNetLog& net_log) override; | 64 const NetLogWithSource& net_log) override; |
| 65 | 65 |
| 66 void PreconnectStreams(int num_streams, const HttpRequestInfo& info) override; | 66 void PreconnectStreams(int num_streams, const HttpRequestInfo& info) override; |
| 67 const HostMappingRules* GetHostMappingRules() const override; | 67 const HostMappingRules* GetHostMappingRules() const override; |
| 68 | 68 |
| 69 enum JobType { | 69 enum JobType { |
| 70 MAIN, | 70 MAIN, |
| 71 ALTERNATIVE, | 71 ALTERNATIVE, |
| 72 PRECONNECT, | 72 PRECONNECT, |
| 73 }; | 73 }; |
| 74 | 74 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 HttpStreamRequest* RequestStreamInternal( | 96 HttpStreamRequest* RequestStreamInternal( |
| 97 const HttpRequestInfo& info, | 97 const HttpRequestInfo& info, |
| 98 RequestPriority priority, | 98 RequestPriority priority, |
| 99 const SSLConfig& server_ssl_config, | 99 const SSLConfig& server_ssl_config, |
| 100 const SSLConfig& proxy_ssl_config, | 100 const SSLConfig& proxy_ssl_config, |
| 101 HttpStreamRequest::Delegate* delegate, | 101 HttpStreamRequest::Delegate* delegate, |
| 102 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 102 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
| 103 HttpStreamRequest::StreamType stream_type, | 103 HttpStreamRequest::StreamType stream_type, |
| 104 const BoundNetLog& net_log); | 104 const NetLogWithSource& net_log); |
| 105 | 105 |
| 106 // Called when a SpdySession is ready. It will find appropriate Requests and | 106 // Called when a SpdySession is ready. It will find appropriate Requests and |
| 107 // fulfill them. |direct| indicates whether or not |spdy_session| uses a | 107 // fulfill them. |direct| indicates whether or not |spdy_session| uses a |
| 108 // proxy. | 108 // proxy. |
| 109 void OnNewSpdySessionReady(const base::WeakPtr<SpdySession>& spdy_session, | 109 void OnNewSpdySessionReady(const base::WeakPtr<SpdySession>& spdy_session, |
| 110 bool direct, | 110 bool direct, |
| 111 const SSLConfig& used_ssl_config, | 111 const SSLConfig& used_ssl_config, |
| 112 const ProxyInfo& used_proxy_info, | 112 const ProxyInfo& used_proxy_info, |
| 113 bool was_alpn_negotiated, | 113 bool was_alpn_negotiated, |
| 114 NextProto negotiated_protocol, | 114 NextProto negotiated_protocol, |
| 115 bool using_spdy, | 115 bool using_spdy, |
| 116 const BoundNetLog& net_log); | 116 const NetLogWithSource& net_log); |
| 117 | 117 |
| 118 // Called when the Job detects that the endpoint indicated by the | 118 // Called when the Job detects that the endpoint indicated by the |
| 119 // Alternate-Protocol does not work. Lets the factory update | 119 // Alternate-Protocol does not work. Lets the factory update |
| 120 // HttpAlternateProtocols with the failure and resets the SPDY session key. | 120 // HttpAlternateProtocols with the failure and resets the SPDY session key. |
| 121 void OnBrokenAlternateProtocol(const Job*, const HostPortPair& origin); | 121 void OnBrokenAlternateProtocol(const Job*, const HostPortPair& origin); |
| 122 | 122 |
| 123 // Called when the Preconnect completes. Used for testing. | 123 // Called when the Preconnect completes. Used for testing. |
| 124 virtual void OnPreconnectsCompleteInternal() {} | 124 virtual void OnPreconnectsCompleteInternal() {} |
| 125 | 125 |
| 126 // Called when the JobController finishes service. Delete the JobController | 126 // Called when the JobController finishes service. Delete the JobController |
| (...skipping 19 matching lines...) Expand all Loading... |
| 146 | 146 |
| 147 SpdySessionRequestMap spdy_session_request_map_; | 147 SpdySessionRequestMap spdy_session_request_map_; |
| 148 | 148 |
| 149 const bool for_websockets_; | 149 const bool for_websockets_; |
| 150 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); | 150 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace net | 153 } // namespace net |
| 154 | 154 |
| 155 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 155 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
| OLD | NEW |