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 #include "net/http/http_network_session.h" | 5 #include "net/http/http_network_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "net/http/http_auth_handler_factory.h" | 15 #include "net/http/http_auth_handler_factory.h" |
16 #include "net/http/http_response_body_drainer.h" | 16 #include "net/http/http_response_body_drainer.h" |
17 #include "net/http/http_stream_factory_impl.h" | 17 #include "net/http/http_stream_factory_impl.h" |
18 #include "net/http/url_security_manager.h" | 18 #include "net/http/url_security_manager.h" |
19 #include "net/proxy/proxy_service.h" | 19 #include "net/proxy/proxy_service.h" |
20 #include "net/quic/crypto/quic_random.h" | 20 #include "net/quic/crypto/quic_random.h" |
21 #include "net/quic/quic_clock.h" | 21 #include "net/quic/quic_clock.h" |
22 #include "net/quic/quic_crypto_client_stream_factory.h" | 22 #include "net/quic/quic_crypto_client_stream_factory.h" |
23 #include "net/quic/quic_protocol.h" | 23 #include "net/quic/quic_protocol.h" |
24 #include "net/quic/quic_stream_factory.h" | 24 #include "net/quic/quic_stream_factory.h" |
25 #include "net/quic/quic_utils.h" | |
25 #include "net/socket/client_socket_factory.h" | 26 #include "net/socket/client_socket_factory.h" |
26 #include "net/socket/client_socket_pool_manager_impl.h" | 27 #include "net/socket/client_socket_pool_manager_impl.h" |
27 #include "net/socket/next_proto.h" | 28 #include "net/socket/next_proto.h" |
28 #include "net/spdy/hpack_huffman_aggregator.h" | 29 #include "net/spdy/hpack_huffman_aggregator.h" |
29 #include "net/spdy/spdy_session_pool.h" | 30 #include "net/spdy/spdy_session_pool.h" |
30 | 31 |
31 namespace { | 32 namespace { |
32 | 33 |
33 net::ClientSocketPoolManager* CreateSocketPoolManager( | 34 net::ClientSocketPoolManager* CreateSocketPoolManager( |
34 net::HttpNetworkSession::SocketPoolType pool_type, | 35 net::HttpNetworkSession::SocketPoolType pool_type, |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { | 244 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { |
244 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 245 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
245 } | 246 } |
246 | 247 |
247 base::Value* HttpNetworkSession::QuicInfoToValue() const { | 248 base::Value* HttpNetworkSession::QuicInfoToValue() const { |
248 base::DictionaryValue* dict = new base::DictionaryValue(); | 249 base::DictionaryValue* dict = new base::DictionaryValue(); |
249 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); | 250 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); |
250 dict->SetBoolean("quic_enabled", params_.enable_quic); | 251 dict->SetBoolean("quic_enabled", params_.enable_quic); |
251 dict->SetBoolean("enable_quic_port_selection", | 252 dict->SetBoolean("enable_quic_port_selection", |
252 params_.enable_quic_port_selection); | 253 params_.enable_quic_port_selection); |
253 dict->SetBoolean("enable_quic_pacing", | 254 base::ListValue* connection_options = new base::ListValue; |
254 ContainsQuicTag(params_.quic_connection_options, kPACE)); | 255 for (QuicTagVector::const_iterator it = |
256 params_.quic_connection_options.begin(); | |
257 it != params_.quic_connection_options.end(); ++it) { | |
258 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); | |
eroman
2014/08/15 22:38:01
why is the string quoted?
| |
259 } | |
260 dict->Set("connection_options", connection_options); | |
255 dict->SetBoolean("enable_quic_time_based_loss_detection", | 261 dict->SetBoolean("enable_quic_time_based_loss_detection", |
256 params_.enable_quic_time_based_loss_detection); | 262 params_.enable_quic_time_based_loss_detection); |
257 dict->SetString("origin_to_force_quic_on", | 263 dict->SetString("origin_to_force_quic_on", |
258 params_.origin_to_force_quic_on.ToString()); | 264 params_.origin_to_force_quic_on.ToString()); |
259 return dict; | 265 return dict; |
260 } | 266 } |
261 | 267 |
262 void HttpNetworkSession::CloseAllConnections() { | 268 void HttpNetworkSession::CloseAllConnections() { |
263 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 269 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
264 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 270 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 case WEBSOCKET_SOCKET_POOL: | 307 case WEBSOCKET_SOCKET_POOL: |
302 return websocket_socket_pool_manager_.get(); | 308 return websocket_socket_pool_manager_.get(); |
303 default: | 309 default: |
304 NOTREACHED(); | 310 NOTREACHED(); |
305 break; | 311 break; |
306 } | 312 } |
307 return NULL; | 313 return NULL; |
308 } | 314 } |
309 | 315 |
310 } // namespace net | 316 } // namespace net |
OLD | NEW |