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_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } else if (stream_factory_->for_websockets_) { | 223 } else if (stream_factory_->for_websockets_) { |
224 // We cancel this job because WebSocketStream can't be created | 224 // We cancel this job because WebSocketStream can't be created |
225 // without a WebSocketStreamBase::Factory which is stored in Request class | 225 // without a WebSocketStreamBase::Factory which is stored in Request class |
226 // and isn't accessible from this job. | 226 // and isn't accessible from this job. |
227 if (connection_ && connection_->socket()) | 227 if (connection_ && connection_->socket()) |
228 connection_->socket()->Disconnect(); | 228 connection_->socket()->Disconnect(); |
229 stream_factory_->OnOrphanedJobComplete(this); | 229 stream_factory_->OnOrphanedJobComplete(this); |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
| 233 void HttpStreamFactoryImpl::Job::SetPriority(RequestPriority priority) { |
| 234 priority_ = priority; |
| 235 // TODO(akalin): Propagate this to |connection_| and maybe the |
| 236 // preconnect state. |
| 237 } |
| 238 |
233 bool HttpStreamFactoryImpl::Job::was_npn_negotiated() const { | 239 bool HttpStreamFactoryImpl::Job::was_npn_negotiated() const { |
234 return was_npn_negotiated_; | 240 return was_npn_negotiated_; |
235 } | 241 } |
236 | 242 |
237 NextProto HttpStreamFactoryImpl::Job::protocol_negotiated() | 243 NextProto HttpStreamFactoryImpl::Job::protocol_negotiated() const { |
238 const { | |
239 return protocol_negotiated_; | 244 return protocol_negotiated_; |
240 } | 245 } |
241 | 246 |
242 bool HttpStreamFactoryImpl::Job::using_spdy() const { | 247 bool HttpStreamFactoryImpl::Job::using_spdy() const { |
243 return using_spdy_; | 248 return using_spdy_; |
244 } | 249 } |
245 | 250 |
246 const SSLConfig& HttpStreamFactoryImpl::Job::server_ssl_config() const { | 251 const SSLConfig& HttpStreamFactoryImpl::Job::server_ssl_config() const { |
247 return server_ssl_config_; | 252 return server_ssl_config_; |
248 } | 253 } |
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | | 1471 (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH | |
1467 net::LOAD_IS_DOWNLOAD)) { | 1472 net::LOAD_IS_DOWNLOAD)) { |
1468 // Avoid pipelining resources that may be streamed for a long time. | 1473 // Avoid pipelining resources that may be streamed for a long time. |
1469 return false; | 1474 return false; |
1470 } | 1475 } |
1471 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( | 1476 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( |
1472 *http_pipelining_key_.get()); | 1477 *http_pipelining_key_.get()); |
1473 } | 1478 } |
1474 | 1479 |
1475 } // namespace net | 1480 } // namespace net |
OLD | NEW |