Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 11364057: Set blocked_on_delegate_ when a URLRequest is blocked during redirects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix comment Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 if (context->network_delegate()) { 782 if (context->network_delegate()) {
783 // Note that |this| may not be deleted until 783 // Note that |this| may not be deleted until
784 // |on_headers_received_callback_| or 784 // |on_headers_received_callback_| or
785 // |NetworkDelegate::URLRequestDestroyed()| has been called. 785 // |NetworkDelegate::URLRequestDestroyed()| has been called.
786 int error = context->network_delegate()-> 786 int error = context->network_delegate()->
787 NotifyHeadersReceived(request_, on_headers_received_callback_, 787 NotifyHeadersReceived(request_, on_headers_received_callback_,
788 headers, &override_response_headers_); 788 headers, &override_response_headers_);
789 if (error != net::OK) { 789 if (error != net::OK) {
790 if (error == net::ERR_IO_PENDING) { 790 if (error == net::ERR_IO_PENDING) {
791 awaiting_callback_ = true; 791 awaiting_callback_ = true;
792 request_->net_log().BeginEvent( 792 SetBlockedOnDelegate();
793 NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE);
794 } else { 793 } else {
795 std::string source("delegate"); 794 std::string source("delegate");
796 request_->net_log().AddEvent(NetLog::TYPE_CANCELLED, 795 request_->net_log().AddEvent(NetLog::TYPE_CANCELLED,
797 NetLog::StringCallback("source", 796 NetLog::StringCallback("source",
798 &source)); 797 &source));
799 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error)); 798 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error));
800 } 799 }
801 return; 800 return;
802 } 801 }
803 } 802 }
(...skipping 14 matching lines...) Expand all
818 NotifySSLCertificateError(transaction_->GetResponseInfo()->ssl_info, fatal); 817 NotifySSLCertificateError(transaction_->GetResponseInfo()->ssl_info, fatal);
819 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { 818 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) {
820 NotifyCertificateRequested( 819 NotifyCertificateRequested(
821 transaction_->GetResponseInfo()->cert_request_info); 820 transaction_->GetResponseInfo()->cert_request_info);
822 } else { 821 } else {
823 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); 822 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result));
824 } 823 }
825 } 824 }
826 825
827 void URLRequestHttpJob::OnHeadersReceivedCallback(int result) { 826 void URLRequestHttpJob::OnHeadersReceivedCallback(int result) {
828 request_->net_log().EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE); 827 SetUnblockedOnDelegate();
829 awaiting_callback_ = false; 828 awaiting_callback_ = false;
830 829
831 // Check that there are no callbacks to already canceled requests. 830 // Check that there are no callbacks to already canceled requests.
832 DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status()); 831 DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status());
833 832
834 SaveCookiesAndNotifyHeadersComplete(result); 833 SaveCookiesAndNotifyHeadersComplete(result);
835 } 834 }
836 835
837 void URLRequestHttpJob::OnReadCompleted(int result) { 836 void URLRequestHttpJob::OnReadCompleted(int result) {
838 read_in_progress_ = false; 837 read_in_progress_ = false;
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 1503
1505 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1504 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1506 awaiting_callback_ = false; 1505 awaiting_callback_ = false;
1507 } 1506 }
1508 1507
1509 void URLRequestHttpJob::OnDetachRequest() { 1508 void URLRequestHttpJob::OnDetachRequest() {
1510 http_transaction_delegate_->OnDetachRequest(); 1509 http_transaction_delegate_->OnDetachRequest();
1511 } 1510 }
1512 1511
1513 } // namespace net 1512 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698