| 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_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const { | 183 const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const { |
| 184 return session_->params().host_mapping_rules; | 184 return session_->params().host_mapping_rules; |
| 185 } | 185 } |
| 186 | 186 |
| 187 void HttpStreamFactoryImpl::OnNewSpdySessionReady( | 187 void HttpStreamFactoryImpl::OnNewSpdySessionReady( |
| 188 const base::WeakPtr<SpdySession>& spdy_session, | 188 const base::WeakPtr<SpdySession>& spdy_session, |
| 189 bool direct, | 189 bool direct, |
| 190 const SSLConfig& used_ssl_config, | 190 const SSLConfig& used_ssl_config, |
| 191 const ProxyInfo& used_proxy_info, | 191 const ProxyInfo& used_proxy_info, |
| 192 bool was_npn_negotiated, | 192 bool was_alpn_negotiated, |
| 193 NextProto negotiated_protocol, | 193 NextProto negotiated_protocol, |
| 194 bool using_spdy, | 194 bool using_spdy, |
| 195 const BoundNetLog& net_log) { | 195 const BoundNetLog& net_log) { |
| 196 while (true) { | 196 while (true) { |
| 197 if (!spdy_session) | 197 if (!spdy_session) |
| 198 break; | 198 break; |
| 199 const SpdySessionKey& spdy_session_key = spdy_session->spdy_session_key(); | 199 const SpdySessionKey& spdy_session_key = spdy_session->spdy_session_key(); |
| 200 // Each iteration may empty out the RequestSet for |spdy_session_key| in | 200 // Each iteration may empty out the RequestSet for |spdy_session_key| in |
| 201 // |spdy_session_request_map_|. So each time, check for RequestSet and use | 201 // |spdy_session_request_map_|. So each time, check for RequestSet and use |
| 202 // the first one. | 202 // the first one. |
| 203 // | 203 // |
| 204 // TODO(willchan): If it's important, switch RequestSet out for a FIFO | 204 // TODO(willchan): If it's important, switch RequestSet out for a FIFO |
| 205 // queue (Order by priority first, then FIFO within same priority). Unclear | 205 // queue (Order by priority first, then FIFO within same priority). Unclear |
| 206 // that it matters here. | 206 // that it matters here. |
| 207 if (!base::ContainsKey(spdy_session_request_map_, spdy_session_key)) | 207 if (!base::ContainsKey(spdy_session_request_map_, spdy_session_key)) |
| 208 break; | 208 break; |
| 209 Request* request = *spdy_session_request_map_[spdy_session_key].begin(); | 209 Request* request = *spdy_session_request_map_[spdy_session_key].begin(); |
| 210 request->Complete(was_npn_negotiated, negotiated_protocol, using_spdy); | 210 request->Complete(was_alpn_negotiated, negotiated_protocol, using_spdy); |
| 211 if (for_websockets_) { | 211 if (for_websockets_) { |
| 212 // TODO(ricea): Restore this code path when WebSocket over SPDY | 212 // TODO(ricea): Restore this code path when WebSocket over SPDY |
| 213 // implementation is ready. | 213 // implementation is ready. |
| 214 NOTREACHED(); | 214 NOTREACHED(); |
| 215 } else if (request->stream_type() == | 215 } else if (request->stream_type() == |
| 216 HttpStreamRequest::BIDIRECTIONAL_STREAM) { | 216 HttpStreamRequest::BIDIRECTIONAL_STREAM) { |
| 217 request->OnBidirectionalStreamImplReady( | 217 request->OnBidirectionalStreamImplReady( |
| 218 used_ssl_config, used_proxy_info, | 218 used_ssl_config, used_proxy_info, |
| 219 new BidirectionalStreamSpdyImpl(spdy_session)); | 219 new BidirectionalStreamSpdyImpl(spdy_session)); |
| 220 } else { | 220 } else { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 232 ++it) { | 232 ++it) { |
| 233 if (it->get() == controller) { | 233 if (it->get() == controller) { |
| 234 job_controller_set_.erase(it); | 234 job_controller_set_.erase(it); |
| 235 return; | 235 return; |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 NOTREACHED(); | 238 NOTREACHED(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace net | 241 } // namespace net |
| OLD | NEW |