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_NETWORK_SESSION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_SESSION_H_ |
6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_SESSION_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
| 10 #include <vector> |
10 | 11 |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
15 #include "net/base/host_port_pair.h" | 16 #include "net/base/host_port_pair.h" |
16 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
17 #include "net/dns/host_resolver.h" | 18 #include "net/dns/host_resolver.h" |
18 #include "net/http/http_auth_cache.h" | 19 #include "net/http/http_auth_cache.h" |
19 #include "net/http/http_stream_factory.h" | 20 #include "net/http/http_stream_factory.h" |
20 #include "net/quic/quic_stream_factory.h" | 21 #include "net/quic/quic_stream_factory.h" |
| 22 #include "net/socket/next_proto.h" |
21 #include "net/spdy/spdy_session_pool.h" | 23 #include "net/spdy/spdy_session_pool.h" |
22 #include "net/ssl/ssl_client_auth_cache.h" | 24 #include "net/ssl/ssl_client_auth_cache.h" |
23 | 25 |
24 namespace base { | 26 namespace base { |
25 class Value; | 27 class Value; |
26 } | 28 } |
27 | 29 |
28 namespace net { | 30 namespace net { |
29 | 31 |
30 class CertVerifier; | 32 class CertVerifier; |
31 class ClientSocketFactory; | 33 class ClientSocketFactory; |
32 class ClientSocketPoolManager; | 34 class ClientSocketPoolManager; |
| 35 class CTVerifier; |
33 class HostResolver; | 36 class HostResolver; |
34 class HpackHuffmanAggregator; | 37 class HpackHuffmanAggregator; |
35 class HttpAuthHandlerFactory; | 38 class HttpAuthHandlerFactory; |
36 class HttpNetworkSessionPeer; | 39 class HttpNetworkSessionPeer; |
37 class HttpProxyClientSocketPool; | 40 class HttpProxyClientSocketPool; |
38 class HttpResponseBodyDrainer; | 41 class HttpResponseBodyDrainer; |
39 class HttpServerProperties; | 42 class HttpServerProperties; |
40 class NetLog; | 43 class NetLog; |
41 class NetworkDelegate; | 44 class NetworkDelegate; |
42 class ServerBoundCertService; | 45 class ServerBoundCertService; |
(...skipping 28 matching lines...) Expand all Loading... |
71 HttpAuthHandlerFactory* http_auth_handler_factory; | 74 HttpAuthHandlerFactory* http_auth_handler_factory; |
72 NetworkDelegate* network_delegate; | 75 NetworkDelegate* network_delegate; |
73 base::WeakPtr<HttpServerProperties> http_server_properties; | 76 base::WeakPtr<HttpServerProperties> http_server_properties; |
74 NetLog* net_log; | 77 NetLog* net_log; |
75 HostMappingRules* host_mapping_rules; | 78 HostMappingRules* host_mapping_rules; |
76 bool force_http_pipelining; | 79 bool force_http_pipelining; |
77 bool ignore_certificate_errors; | 80 bool ignore_certificate_errors; |
78 bool http_pipelining_enabled; | 81 bool http_pipelining_enabled; |
79 uint16 testing_fixed_http_port; | 82 uint16 testing_fixed_http_port; |
80 uint16 testing_fixed_https_port; | 83 uint16 testing_fixed_https_port; |
| 84 |
81 bool force_spdy_single_domain; | 85 bool force_spdy_single_domain; |
82 bool enable_spdy_compression; | 86 bool enable_spdy_compression; |
83 bool enable_spdy_ping_based_connection_checking; | 87 bool enable_spdy_ping_based_connection_checking; |
84 NextProto spdy_default_protocol; | 88 NextProto spdy_default_protocol; |
| 89 // The protocols supported by NPN (next protocol negotiation) during the |
| 90 // SSL handshake as well as by HTTP Alternate-Protocol. |
| 91 // TODO(mmenke): This is currently empty by default, and alternate |
| 92 // protocols are disabled. We should use some reasonable |
| 93 // defaults. |
| 94 NextProtoVector next_protos; |
85 size_t spdy_stream_initial_recv_window_size; | 95 size_t spdy_stream_initial_recv_window_size; |
86 size_t spdy_initial_max_concurrent_streams; | 96 size_t spdy_initial_max_concurrent_streams; |
87 size_t spdy_max_concurrent_streams_limit; | 97 size_t spdy_max_concurrent_streams_limit; |
88 SpdySessionPool::TimeFunc time_func; | 98 SpdySessionPool::TimeFunc time_func; |
89 std::string trusted_spdy_proxy; | 99 std::string trusted_spdy_proxy; |
| 100 // Controls whether or not ssl is used when in SPDY mode. |
| 101 bool force_spdy_over_ssl; |
| 102 // Controls whether or not SPDY is used without NPN. |
| 103 bool force_spdy_always; |
| 104 // URLs to exclude from forced SPDY. |
| 105 std::set<HostPortPair> forced_spdy_exclusions; |
| 106 // Noe: Using this in the case of NPN for HTTP only results in the browser |
| 107 // trying SSL and then falling back to http. |
| 108 bool use_alternate_protocols; |
| 109 |
90 bool enable_quic; | 110 bool enable_quic; |
91 bool enable_quic_https; | 111 bool enable_quic_https; |
92 bool enable_quic_port_selection; | 112 bool enable_quic_port_selection; |
93 bool enable_quic_pacing; | 113 bool enable_quic_pacing; |
94 bool enable_quic_time_based_loss_detection; | 114 bool enable_quic_time_based_loss_detection; |
95 bool enable_quic_persist_server_info; | 115 bool enable_quic_persist_server_info; |
96 HostPortPair origin_to_force_quic_on; | 116 HostPortPair origin_to_force_quic_on; |
97 QuicClock* quic_clock; // Will be owned by QuicStreamFactory. | 117 QuicClock* quic_clock; // Will be owned by QuicStreamFactory. |
98 QuicRandom* quic_random; | 118 QuicRandom* quic_random; |
99 size_t quic_max_packet_length; | 119 size_t quic_max_packet_length; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 195 |
176 bool force_http_pipelining() const { return force_http_pipelining_; } | 196 bool force_http_pipelining() const { return force_http_pipelining_; } |
177 | 197 |
178 // Returns the original Params used to construct this session. | 198 // Returns the original Params used to construct this session. |
179 const Params& params() const { return params_; } | 199 const Params& params() const { return params_; } |
180 | 200 |
181 void set_http_pipelining_enabled(bool enable) { | 201 void set_http_pipelining_enabled(bool enable) { |
182 params_.http_pipelining_enabled = enable; | 202 params_.http_pipelining_enabled = enable; |
183 } | 203 } |
184 | 204 |
| 205 bool IsProtocolEnabled(AlternateProtocol protocol) const; |
| 206 |
| 207 void GetNextProtos(std::vector<std::string>* next_protos) const; |
| 208 |
| 209 // Convenience function for searching through |params_| for |
| 210 // |forced_spdy_exclusions|. |
| 211 bool HasSpdyExclusion(HostPortPair host_port_pair) const; |
| 212 |
185 private: | 213 private: |
186 friend class base::RefCounted<HttpNetworkSession>; | 214 friend class base::RefCounted<HttpNetworkSession>; |
187 friend class HttpNetworkSessionPeer; | 215 friend class HttpNetworkSessionPeer; |
188 | 216 |
189 ~HttpNetworkSession(); | 217 ~HttpNetworkSession(); |
190 | 218 |
191 ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type); | 219 ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type); |
192 | 220 |
193 NetLog* const net_log_; | 221 NetLog* const net_log_; |
194 NetworkDelegate* const network_delegate_; | 222 NetworkDelegate* const network_delegate_; |
(...skipping 12 matching lines...) Expand all Loading... |
207 scoped_ptr<ClientSocketPoolManager> websocket_socket_pool_manager_; | 235 scoped_ptr<ClientSocketPoolManager> websocket_socket_pool_manager_; |
208 QuicStreamFactory quic_stream_factory_; | 236 QuicStreamFactory quic_stream_factory_; |
209 SpdySessionPool spdy_session_pool_; | 237 SpdySessionPool spdy_session_pool_; |
210 scoped_ptr<HttpStreamFactory> http_stream_factory_; | 238 scoped_ptr<HttpStreamFactory> http_stream_factory_; |
211 scoped_ptr<HttpStreamFactory> http_stream_factory_for_websocket_; | 239 scoped_ptr<HttpStreamFactory> http_stream_factory_for_websocket_; |
212 std::set<HttpResponseBodyDrainer*> response_drainers_; | 240 std::set<HttpResponseBodyDrainer*> response_drainers_; |
213 | 241 |
214 // TODO(jgraettinger): Remove when Huffman collection is complete. | 242 // TODO(jgraettinger): Remove when Huffman collection is complete. |
215 scoped_ptr<HpackHuffmanAggregator> huffman_aggregator_; | 243 scoped_ptr<HpackHuffmanAggregator> huffman_aggregator_; |
216 | 244 |
| 245 std::vector<std::string> next_protos_; |
| 246 bool enabled_protocols_[NUM_VALID_ALTERNATE_PROTOCOLS]; |
| 247 |
217 Params params_; | 248 Params params_; |
218 }; | 249 }; |
219 | 250 |
220 } // namespace net | 251 } // namespace net |
221 | 252 |
222 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ | 253 #endif // NET_HTTP_HTTP_NETWORK_SESSION_H_ |
OLD | NEW |