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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 Value* HttpNetworkSession::SocketPoolInfoToValue() const { | 165 Value* HttpNetworkSession::SocketPoolInfoToValue() const { |
166 // TODO(yutak): Should merge values from normal pools and WebSocket pools. | 166 // TODO(yutak): Should merge values from normal pools and WebSocket pools. |
167 return normal_socket_pool_manager_->SocketPoolInfoToValue(); | 167 return normal_socket_pool_manager_->SocketPoolInfoToValue(); |
168 } | 168 } |
169 | 169 |
170 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { | 170 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { |
171 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 171 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
172 } | 172 } |
173 | 173 |
174 void HttpNetworkSession::CloseAllConnections() { | 174 void HttpNetworkSession::CloseAllConnections() { |
175 normal_socket_pool_manager_->FlushSocketPools(); | 175 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
176 websocket_socket_pool_manager_->FlushSocketPools(); | 176 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
177 spdy_session_pool_.CloseCurrentSessions(); | 177 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
178 } | 178 } |
179 | 179 |
180 void HttpNetworkSession::CloseIdleConnections() { | 180 void HttpNetworkSession::CloseIdleConnections() { |
181 normal_socket_pool_manager_->CloseIdleSockets(); | 181 normal_socket_pool_manager_->CloseIdleSockets(); |
182 websocket_socket_pool_manager_->CloseIdleSockets(); | 182 websocket_socket_pool_manager_->CloseIdleSockets(); |
183 spdy_session_pool_.CloseIdleSessions(); | 183 spdy_session_pool_.CloseIdleSessions(); |
184 } | 184 } |
185 | 185 |
186 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( | 186 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( |
187 SocketPoolType pool_type) { | 187 SocketPoolType pool_type) { |
188 switch (pool_type) { | 188 switch (pool_type) { |
189 case NORMAL_SOCKET_POOL: | 189 case NORMAL_SOCKET_POOL: |
190 return normal_socket_pool_manager_.get(); | 190 return normal_socket_pool_manager_.get(); |
191 case WEBSOCKET_SOCKET_POOL: | 191 case WEBSOCKET_SOCKET_POOL: |
192 return websocket_socket_pool_manager_.get(); | 192 return websocket_socket_pool_manager_.get(); |
193 default: | 193 default: |
194 NOTREACHED(); | 194 NOTREACHED(); |
195 break; | 195 break; |
196 } | 196 } |
197 return NULL; | 197 return NULL; |
198 } | 198 } |
199 | 199 |
200 } // namespace net | 200 } // namespace net |
OLD | NEW |