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/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 if (transaction_.get()) { | 421 if (transaction_.get()) { |
422 rv = transaction_->RestartWithAuth(auth_credentials_, start_callback_); | 422 rv = transaction_->RestartWithAuth(auth_credentials_, start_callback_); |
423 auth_credentials_ = AuthCredentials(); | 423 auth_credentials_ = AuthCredentials(); |
424 } else { | 424 } else { |
425 DCHECK(request_->context()->http_transaction_factory()); | 425 DCHECK(request_->context()->http_transaction_factory()); |
426 | 426 |
427 rv = request_->context()->http_transaction_factory()->CreateTransaction( | 427 rv = request_->context()->http_transaction_factory()->CreateTransaction( |
428 priority_, &transaction_); | 428 priority_, &transaction_); |
429 | 429 |
430 if (rv == OK && request_info_.url.SchemeIsWSOrWSS()) { | 430 if (rv == OK && request_info_.url.SchemeIsWSOrWSS()) { |
431 // TODO(ricea): Implement WebSocket throttling semantics as defined in | |
432 // RFC6455 Section 4.1. | |
433 base::SupportsUserData::Data* data = request_->GetUserData( | 431 base::SupportsUserData::Data* data = request_->GetUserData( |
434 WebSocketHandshakeStreamBase::CreateHelper::DataKey()); | 432 WebSocketHandshakeStreamBase::CreateHelper::DataKey()); |
435 if (data) { | 433 if (data) { |
436 transaction_->SetWebSocketHandshakeStreamCreateHelper( | 434 transaction_->SetWebSocketHandshakeStreamCreateHelper( |
437 static_cast<WebSocketHandshakeStreamBase::CreateHelper*>(data)); | 435 static_cast<WebSocketHandshakeStreamBase::CreateHelper*>(data)); |
438 } else { | 436 } else { |
439 rv = ERR_DISALLOWED_URL_SCHEME; | 437 rv = ERR_DISALLOWED_URL_SCHEME; |
440 } | 438 } |
441 } | 439 } |
442 | 440 |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 return override_response_headers_.get() ? | 1521 return override_response_headers_.get() ? |
1524 override_response_headers_.get() : | 1522 override_response_headers_.get() : |
1525 transaction_->GetResponseInfo()->headers.get(); | 1523 transaction_->GetResponseInfo()->headers.get(); |
1526 } | 1524 } |
1527 | 1525 |
1528 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1526 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1529 awaiting_callback_ = false; | 1527 awaiting_callback_ = false; |
1530 } | 1528 } |
1531 | 1529 |
1532 } // namespace net | 1530 } // namespace net |
OLD | NEW |