| 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/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // Each iteration may empty out the RequestSet for |spdy_session_key| in | 231 // Each iteration may empty out the RequestSet for |spdy_session_key| in |
| 232 // |spdy_session_request_map_|. So each time, check for RequestSet and use | 232 // |spdy_session_request_map_|. So each time, check for RequestSet and use |
| 233 // the first one. | 233 // the first one. |
| 234 // | 234 // |
| 235 // TODO(willchan): If it's important, switch RequestSet out for a FIFO | 235 // TODO(willchan): If it's important, switch RequestSet out for a FIFO |
| 236 // queue (Order by priority first, then FIFO within same priority). Unclear | 236 // queue (Order by priority first, then FIFO within same priority). Unclear |
| 237 // that it matters here. | 237 // that it matters here. |
| 238 if (!ContainsKey(spdy_session_request_map_, spdy_session_key)) | 238 if (!ContainsKey(spdy_session_request_map_, spdy_session_key)) |
| 239 break; | 239 break; |
| 240 Request* request = *spdy_session_request_map_[spdy_session_key].begin(); | 240 Request* request = *spdy_session_request_map_[spdy_session_key].begin(); |
| 241 request->Complete(was_npn_negotiated, | 241 request->Complete(was_npn_negotiated, protocol_negotiated, using_spdy); |
| 242 protocol_negotiated, | |
| 243 using_spdy, | |
| 244 net_log); | |
| 245 if (for_websockets_) { | 242 if (for_websockets_) { |
| 246 // TODO(ricea): Restore this code path when WebSocket over SPDY | 243 // TODO(ricea): Restore this code path when WebSocket over SPDY |
| 247 // implementation is ready. | 244 // implementation is ready. |
| 248 NOTREACHED(); | 245 NOTREACHED(); |
| 249 } else { | 246 } else { |
| 250 bool use_relative_url = direct || request->url().SchemeIs("https"); | 247 bool use_relative_url = direct || request->url().SchemeIs("https"); |
| 251 request->OnStreamReady( | 248 request->OnStreamReady( |
| 252 NULL, | 249 NULL, |
| 253 used_ssl_config, | 250 used_ssl_config, |
| 254 used_proxy_info, | 251 used_proxy_info, |
| 255 new SpdyHttpStream(spdy_session, use_relative_url)); | 252 new SpdyHttpStream(spdy_session, use_relative_url)); |
| 256 } | 253 } |
| 257 } | 254 } |
| 258 // TODO(mbelshe): Alert other valid requests. | 255 // TODO(mbelshe): Alert other valid requests. |
| 259 } | 256 } |
| 260 | 257 |
| 261 void HttpStreamFactoryImpl::OnOrphanedJobComplete(const Job* job) { | 258 void HttpStreamFactoryImpl::OnOrphanedJobComplete(const Job* job) { |
| 262 orphaned_job_set_.erase(job); | 259 orphaned_job_set_.erase(job); |
| 263 delete job; | 260 delete job; |
| 264 } | 261 } |
| 265 | 262 |
| 266 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 263 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
| 267 preconnect_job_set_.erase(job); | 264 preconnect_job_set_.erase(job); |
| 268 delete job; | 265 delete job; |
| 269 OnPreconnectsCompleteInternal(); | 266 OnPreconnectsCompleteInternal(); |
| 270 } | 267 } |
| 271 | 268 |
| 272 } // namespace net | 269 } // namespace net |
| OLD | NEW |