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_ftp_job.h" | 5 #include "net/url_request/url_request_ftp_job.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 scoped_refptr<AuthChallengeInfo>* result) { | 284 scoped_refptr<AuthChallengeInfo>* result) { |
285 DCHECK(NeedsAuth()); | 285 DCHECK(NeedsAuth()); |
286 | 286 |
287 if (http_response_info_) { | 287 if (http_response_info_) { |
288 *result = http_response_info_->auth_challenge; | 288 *result = http_response_info_->auth_challenge; |
289 return; | 289 return; |
290 } | 290 } |
291 | 291 |
292 scoped_refptr<AuthChallengeInfo> auth_info(new AuthChallengeInfo); | 292 scoped_refptr<AuthChallengeInfo> auth_info(new AuthChallengeInfo); |
293 auth_info->is_proxy = false; | 293 auth_info->is_proxy = false; |
294 auth_info->challenger = HostPortPair::FromURL(request_->url()); | 294 auth_info->challenger = url::Origin(request_->url()); |
295 // scheme and realm are kept empty. | 295 // scheme and realm are kept empty. |
296 DCHECK(auth_info->scheme.empty()); | 296 DCHECK(auth_info->scheme.empty()); |
297 DCHECK(auth_info->realm.empty()); | 297 DCHECK(auth_info->realm.empty()); |
298 result->swap(auth_info); | 298 result->swap(auth_info); |
299 } | 299 } |
300 | 300 |
301 void URLRequestFtpJob::SetAuth(const AuthCredentials& credentials) { | 301 void URLRequestFtpJob::SetAuth(const AuthCredentials& credentials) { |
302 DCHECK(ftp_transaction_ || http_transaction_); | 302 DCHECK(ftp_transaction_ || http_transaction_); |
303 DCHECK(NeedsAuth()); | 303 DCHECK(NeedsAuth()); |
304 | 304 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 if (cached_auth) { | 372 if (cached_auth) { |
373 // Retry using cached auth data. | 373 // Retry using cached auth data. |
374 SetAuth(cached_auth->credentials); | 374 SetAuth(cached_auth->credentials); |
375 } else { | 375 } else { |
376 // Prompt for a username/password. | 376 // Prompt for a username/password. |
377 NotifyHeadersComplete(); | 377 NotifyHeadersComplete(); |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 } // namespace net | 381 } // namespace net |
OLD | NEW |