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

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

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding a call in http_transactions to get the auth info Created 7 years, 8 months 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 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 return true; 1086 return true;
1087 case 401: 1087 case 401:
1088 if (server_auth_state_ == AUTH_STATE_CANCELED) 1088 if (server_auth_state_ == AUTH_STATE_CANCELED)
1089 return false; 1089 return false;
1090 server_auth_state_ = AUTH_STATE_NEED_AUTH; 1090 server_auth_state_ = AUTH_STATE_NEED_AUTH;
1091 return true; 1091 return true;
1092 } 1092 }
1093 return false; 1093 return false;
1094 } 1094 }
1095 1095
1096 bool URLRequestHttpJob::HasAuth() const {
1097 return transaction_.get() ? transaction_->HasAuth() : false;
1098 }
1099
1096 void URLRequestHttpJob::GetAuthChallengeInfo( 1100 void URLRequestHttpJob::GetAuthChallengeInfo(
1097 scoped_refptr<AuthChallengeInfo>* result) { 1101 scoped_refptr<AuthChallengeInfo>* result) {
1098 DCHECK(transaction_.get()); 1102 DCHECK(transaction_.get());
1099 DCHECK(response_info_); 1103 DCHECK(response_info_);
1100 1104
1101 // sanity checks: 1105 // sanity checks:
1102 DCHECK(proxy_auth_state_ == AUTH_STATE_NEED_AUTH || 1106 DCHECK(proxy_auth_state_ == AUTH_STATE_NEED_AUTH ||
1103 server_auth_state_ == AUTH_STATE_NEED_AUTH); 1107 server_auth_state_ == AUTH_STATE_NEED_AUTH);
1104 DCHECK((GetResponseHeaders()->response_code() == HTTP_UNAUTHORIZED) || 1108 DCHECK((GetResponseHeaders()->response_code() == HTTP_UNAUTHORIZED) ||
1105 (GetResponseHeaders()->response_code() == 1109 (GetResponseHeaders()->response_code() ==
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 1580
1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1581 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1578 awaiting_callback_ = false; 1582 awaiting_callback_ = false;
1579 } 1583 }
1580 1584
1581 void URLRequestHttpJob::OnDetachRequest() { 1585 void URLRequestHttpJob::OnDetachRequest() {
1582 http_transaction_delegate_->OnDetachRequest(); 1586 http_transaction_delegate_->OnDetachRequest();
1583 } 1587 }
1584 1588
1585 } // namespace net 1589 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698