| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 DCHECK(!pac_request_); | 95 DCHECK(!pac_request_); |
| 96 DCHECK(!ftp_transaction_); | 96 DCHECK(!ftp_transaction_); |
| 97 DCHECK(!http_transaction_); | 97 DCHECK(!http_transaction_); |
| 98 | 98 |
| 99 int rv = OK; | 99 int rv = OK; |
| 100 if (request_->load_flags() & LOAD_BYPASS_PROXY) { | 100 if (request_->load_flags() & LOAD_BYPASS_PROXY) { |
| 101 proxy_info_.UseDirect(); | 101 proxy_info_.UseDirect(); |
| 102 } else { | 102 } else { |
| 103 DCHECK_EQ(request_->context()->proxy_service(), proxy_service_); | 103 DCHECK_EQ(request_->context()->proxy_service(), proxy_service_); |
| 104 rv = proxy_service_->ResolveProxy( | 104 rv = proxy_service_->ResolveProxy( |
| 105 request_->url(), | 105 request_->url(), request_->method(), request_->load_flags(), |
| 106 request_->load_flags(), | 106 &proxy_info_, base::Bind(&URLRequestFtpJob::OnResolveProxyComplete, |
| 107 &proxy_info_, | 107 base::Unretained(this)), |
| 108 base::Bind(&URLRequestFtpJob::OnResolveProxyComplete, | 108 &pac_request_, NULL, request_->net_log()); |
| 109 base::Unretained(this)), | |
| 110 &pac_request_, | |
| 111 NULL, | |
| 112 request_->net_log()); | |
| 113 | 109 |
| 114 if (rv == ERR_IO_PENDING) | 110 if (rv == ERR_IO_PENDING) |
| 115 return; | 111 return; |
| 116 } | 112 } |
| 117 OnResolveProxyComplete(rv); | 113 OnResolveProxyComplete(rv); |
| 118 } | 114 } |
| 119 | 115 |
| 120 void URLRequestFtpJob::Kill() { | 116 void URLRequestFtpJob::Kill() { |
| 121 if (pac_request_) { | 117 if (pac_request_) { |
| 122 proxy_service_->CancelPacRequest(pac_request_); | 118 proxy_service_->CancelPacRequest(pac_request_); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 if (cached_auth) { | 373 if (cached_auth) { |
| 378 // Retry using cached auth data. | 374 // Retry using cached auth data. |
| 379 SetAuth(cached_auth->credentials); | 375 SetAuth(cached_auth->credentials); |
| 380 } else { | 376 } else { |
| 381 // Prompt for a username/password. | 377 // Prompt for a username/password. |
| 382 NotifyHeadersComplete(); | 378 NotifyHeadersComplete(); |
| 383 } | 379 } |
| 384 } | 380 } |
| 385 | 381 |
| 386 } // namespace net | 382 } // namespace net |
| OLD | NEW |