| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 Value* HttpNetworkSession::SocketPoolInfoToValue() const { | 173 Value* HttpNetworkSession::SocketPoolInfoToValue() const { |
| 174 // TODO(yutak): Should merge values from normal pools and WebSocket pools. | 174 // TODO(yutak): Should merge values from normal pools and WebSocket pools. |
| 175 return normal_socket_pool_manager_->SocketPoolInfoToValue(); | 175 return normal_socket_pool_manager_->SocketPoolInfoToValue(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { | 178 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { |
| 179 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 179 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 Value* HttpNetworkSession::QuicInfoToValue() const { |
| 183 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 184 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); |
| 185 dict->SetBoolean("quic_enabled", params_.origin_port_to_force_quic_on != 0); |
| 186 dict->SetInteger("origin_port_to_force_quic_on", |
| 187 params_.origin_port_to_force_quic_on); |
| 188 |
| 189 return dict; |
| 190 } |
| 191 |
| 182 void HttpNetworkSession::CloseAllConnections() { | 192 void HttpNetworkSession::CloseAllConnections() { |
| 183 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 193 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
| 184 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 194 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
| 185 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 195 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
| 186 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); | 196 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); |
| 187 } | 197 } |
| 188 | 198 |
| 189 void HttpNetworkSession::CloseIdleConnections() { | 199 void HttpNetworkSession::CloseIdleConnections() { |
| 190 normal_socket_pool_manager_->CloseIdleSockets(); | 200 normal_socket_pool_manager_->CloseIdleSockets(); |
| 191 websocket_socket_pool_manager_->CloseIdleSockets(); | 201 websocket_socket_pool_manager_->CloseIdleSockets(); |
| 192 spdy_session_pool_.CloseIdleSessions(); | 202 spdy_session_pool_.CloseIdleSessions(); |
| 193 } | 203 } |
| 194 | 204 |
| 195 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( | 205 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( |
| 196 SocketPoolType pool_type) { | 206 SocketPoolType pool_type) { |
| 197 switch (pool_type) { | 207 switch (pool_type) { |
| 198 case NORMAL_SOCKET_POOL: | 208 case NORMAL_SOCKET_POOL: |
| 199 return normal_socket_pool_manager_.get(); | 209 return normal_socket_pool_manager_.get(); |
| 200 case WEBSOCKET_SOCKET_POOL: | 210 case WEBSOCKET_SOCKET_POOL: |
| 201 return websocket_socket_pool_manager_.get(); | 211 return websocket_socket_pool_manager_.get(); |
| 202 default: | 212 default: |
| 203 NOTREACHED(); | 213 NOTREACHED(); |
| 204 break; | 214 break; |
| 205 } | 215 } |
| 206 return NULL; | 216 return NULL; |
| 207 } | 217 } |
| 208 | 218 |
| 209 } // namespace net | 219 } // namespace net |
| OLD | NEW |