Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "net/http/http_auth_handler_factory.h" | 13 #include "net/http/http_auth_handler_factory.h" |
| 14 #include "net/http/http_response_body_drainer.h" | 14 #include "net/http/http_response_body_drainer.h" |
| 15 #include "net/http/url_security_manager.h" | 15 #include "net/http/url_security_manager.h" |
| 16 #include "net/socket/client_socket_factory.h" | 16 #include "net/socket/client_socket_factory.h" |
| 17 #include "net/socket/ssl_client_socket.h" | |
| 17 #include "net/spdy/spdy_session_pool.h" | 18 #include "net/spdy/spdy_session_pool.h" |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 | 21 |
| 21 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. | 22 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. |
| 22 HttpNetworkSession::HttpNetworkSession(const Params& params) | 23 HttpNetworkSession::HttpNetworkSession(const Params& params) |
| 23 : cert_verifier_(NULL), | 24 : cert_verifier_(NULL), |
| 24 proxy_service_(params.proxy_service), | 25 proxy_service_(params.proxy_service), |
| 25 ssl_config_service_(params.ssl_config_service), | 26 ssl_config_service_(params.ssl_config_service), |
| 26 socket_pool_manager_(params.net_log, | 27 socket_pool_manager_(params.net_log, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 55 void HttpNetworkSession::RemoveResponseDrainer( | 56 void HttpNetworkSession::RemoveResponseDrainer( |
| 56 HttpResponseBodyDrainer* drainer) { | 57 HttpResponseBodyDrainer* drainer) { |
| 57 DCHECK(ContainsKey(response_drainers_, drainer)); | 58 DCHECK(ContainsKey(response_drainers_, drainer)); |
| 58 response_drainers_.erase(drainer); | 59 response_drainers_.erase(drainer); |
| 59 } | 60 } |
| 60 | 61 |
| 61 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { | 62 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { |
| 62 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 63 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
| 63 } | 64 } |
| 64 | 65 |
| 66 void HttpNetworkSession::ResetSSLState() { | |
| 67 // Erase any mapping from host:port to client certificate. | |
| 68 ssl_client_auth_cache()->Clear(); | |
| 69 // Clear any cached ssl sessions so that we do not resume with the old | |
| 70 // certificate. | |
| 71 SSLClientSocket::ClearSSLSessionCache(); | |
| 72 // Close all connections to force a reconnection. | |
| 73 FlushSocketPools(); | |
| 74 spdy_session_pool()->CloseAllSessions(); | |
|
wtc
2011/02/23 00:38:38
Should we imitate NetworkChangeNotifier and add a
| |
| 75 } | |
| 76 | |
| 65 } // namespace net | 77 } // namespace net |
| OLD | NEW |