| 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_layer.h" | 5 #include "net/http/http_network_layer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "net/http/http_network_session.h" | 9 #include "net/http/http_network_session.h" |
| 10 #include "net/http/http_network_transaction.h" | 10 #include "net/http/http_network_transaction.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void HttpNetworkLayer::Suspend(bool suspend) { | 96 void HttpNetworkLayer::Suspend(bool suspend) { |
| 97 suspended_ = suspend; | 97 suspended_ = suspend; |
| 98 | 98 |
| 99 if (suspend && session_) | 99 if (suspend && session_) |
| 100 session_->tcp_socket_pool()->CloseIdleSockets(); | 100 session_->tcp_socket_pool()->CloseIdleSockets(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 HttpNetworkSession* HttpNetworkLayer::GetSession() { | 103 HttpNetworkSession* HttpNetworkLayer::GetSession() { |
| 104 if (!session_) { | 104 if (!session_) { |
| 105 DCHECK(proxy_service_); | 105 DCHECK(proxy_service_); |
| 106 SpdySessionPool* spdy_pool = new SpdySessionPool; |
| 106 session_ = new HttpNetworkSession( | 107 session_ = new HttpNetworkSession( |
| 107 network_change_notifier_, host_resolver_, proxy_service_, | 108 network_change_notifier_, host_resolver_, proxy_service_, |
| 108 socket_factory_, ssl_config_service_, | 109 socket_factory_, ssl_config_service_, spdy_pool, |
| 109 http_auth_handler_factory_); | 110 http_auth_handler_factory_); |
| 110 // These were just temps for lazy-initializing HttpNetworkSession. | 111 // These were just temps for lazy-initializing HttpNetworkSession. |
| 111 network_change_notifier_ = NULL; | 112 network_change_notifier_ = NULL; |
| 112 host_resolver_ = NULL; | 113 host_resolver_ = NULL; |
| 113 proxy_service_ = NULL; | 114 proxy_service_ = NULL; |
| 114 socket_factory_ = NULL; | 115 socket_factory_ = NULL; |
| 115 http_auth_handler_factory_ = NULL; | 116 http_auth_handler_factory_ = NULL; |
| 116 } | 117 } |
| 117 return session_; | 118 return session_; |
| 118 } | 119 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 force_spdy_ = false; | 152 force_spdy_ = false; |
| 152 } else if (option.empty() && it == spdy_options.begin()) { | 153 } else if (option.empty() && it == spdy_options.begin()) { |
| 153 continue; | 154 continue; |
| 154 } else { | 155 } else { |
| 155 LOG(DFATAL) << "Unrecognized spdy option: " << option; | 156 LOG(DFATAL) << "Unrecognized spdy option: " << option; |
| 156 } | 157 } |
| 157 } | 158 } |
| 158 } | 159 } |
| 159 | 160 |
| 160 } // namespace net | 161 } // namespace net |
| OLD | NEW |