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 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |