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" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 base::Value* HttpNetworkSession::SocketPoolInfoToValue() const { | 253 base::Value* HttpNetworkSession::SocketPoolInfoToValue() const { |
254 // TODO(yutak): Should merge values from normal pools and WebSocket pools. | 254 // TODO(yutak): Should merge values from normal pools and WebSocket pools. |
255 return normal_socket_pool_manager_->SocketPoolInfoToValue(); | 255 return normal_socket_pool_manager_->SocketPoolInfoToValue(); |
256 } | 256 } |
257 | 257 |
258 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { | 258 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { |
259 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 259 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
260 } | 260 } |
261 | 261 |
262 base::Value* HttpNetworkSession::QuicInfoToValue() const { | 262 base::Value* HttpNetworkSession::QuicInfoToValue() const { |
263 base::DictionaryValue* dict = new base::DictionaryValue(); | 263 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
264 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); | 264 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); |
265 dict->SetBoolean("quic_enabled", params_.enable_quic); | 265 dict->SetBoolean("quic_enabled", params_.enable_quic); |
266 dict->SetBoolean("quic_enabled_for_proxies", params_.enable_quic_for_proxies); | 266 dict->SetBoolean("quic_enabled_for_proxies", params_.enable_quic_for_proxies); |
267 dict->SetBoolean("enable_quic_port_selection", | 267 dict->SetBoolean("enable_quic_port_selection", |
268 params_.enable_quic_port_selection); | 268 params_.enable_quic_port_selection); |
269 base::ListValue* connection_options = new base::ListValue; | 269 base::ListValue* connection_options = new base::ListValue; |
270 for (QuicTagVector::const_iterator it = | 270 for (QuicTagVector::const_iterator it = |
271 params_.quic_connection_options.begin(); | 271 params_.quic_connection_options.begin(); |
272 it != params_.quic_connection_options.end(); ++it) { | 272 it != params_.quic_connection_options.end(); ++it) { |
273 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); | 273 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); |
274 } | 274 } |
275 dict->Set("connection_options", connection_options); | 275 dict->Set("connection_options", connection_options); |
276 dict->SetString("origin_to_force_quic_on", | 276 dict->SetString("origin_to_force_quic_on", |
277 params_.origin_to_force_quic_on.ToString()); | 277 params_.origin_to_force_quic_on.ToString()); |
278 dict->SetDouble("alternative_service_probability_threshold", | 278 dict->SetDouble("alternative_service_probability_threshold", |
279 params_.alternative_service_probability_threshold); | 279 params_.alternative_service_probability_threshold); |
280 return dict; | 280 return dict.release(); |
281 } | 281 } |
282 | 282 |
283 void HttpNetworkSession::CloseAllConnections() { | 283 void HttpNetworkSession::CloseAllConnections() { |
284 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 284 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
285 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 285 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
286 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 286 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
287 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); | 287 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); |
288 } | 288 } |
289 | 289 |
290 void HttpNetworkSession::CloseIdleConnections() { | 290 void HttpNetworkSession::CloseIdleConnections() { |
(...skipping 30 matching lines...) Expand all Loading... |
321 case WEBSOCKET_SOCKET_POOL: | 321 case WEBSOCKET_SOCKET_POOL: |
322 return websocket_socket_pool_manager_.get(); | 322 return websocket_socket_pool_manager_.get(); |
323 default: | 323 default: |
324 NOTREACHED(); | 324 NOTREACHED(); |
325 break; | 325 break; |
326 } | 326 } |
327 return NULL; | 327 return NULL; |
328 } | 328 } |
329 | 329 |
330 } // namespace net | 330 } // namespace net |
OLD | NEW |