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 } | 196 } |
187 | 197 |
188 void HttpNetworkSession::CloseIdleConnections() { | 198 void HttpNetworkSession::CloseIdleConnections() { |
189 normal_socket_pool_manager_->CloseIdleSockets(); | 199 normal_socket_pool_manager_->CloseIdleSockets(); |
190 websocket_socket_pool_manager_->CloseIdleSockets(); | 200 websocket_socket_pool_manager_->CloseIdleSockets(); |
191 spdy_session_pool_.CloseIdleSessions(); | 201 spdy_session_pool_.CloseIdleSessions(); |
192 } | 202 } |
193 | 203 |
194 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( | 204 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( |
195 SocketPoolType pool_type) { | 205 SocketPoolType pool_type) { |
196 switch (pool_type) { | 206 switch (pool_type) { |
197 case NORMAL_SOCKET_POOL: | 207 case NORMAL_SOCKET_POOL: |
198 return normal_socket_pool_manager_.get(); | 208 return normal_socket_pool_manager_.get(); |
199 case WEBSOCKET_SOCKET_POOL: | 209 case WEBSOCKET_SOCKET_POOL: |
200 return websocket_socket_pool_manager_.get(); | 210 return websocket_socket_pool_manager_.get(); |
201 default: | 211 default: |
202 NOTREACHED(); | 212 NOTREACHED(); |
203 break; | 213 break; |
204 } | 214 } |
205 return NULL; | 215 return NULL; |
206 } | 216 } |
207 | 217 |
208 } // namespace net | 218 } // namespace net |
OLD | NEW |