| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 DCHECK(NeedsAuth()); | 318 DCHECK(NeedsAuth()); |
| 319 | 319 |
| 320 auth_data_->state = AUTH_STATE_CANCELED; | 320 auth_data_->state = AUTH_STATE_CANCELED; |
| 321 | 321 |
| 322 // Once the auth is cancelled, we proceed with the request as though | 322 // Once the auth is cancelled, we proceed with the request as though |
| 323 // there were no auth. Schedule this for later so that we don't cause | 323 // there were no auth. Schedule this for later so that we don't cause |
| 324 // any recursing into the caller as a result of this call. | 324 // any recursing into the caller as a result of this call. |
| 325 OnStartCompletedAsync(OK); | 325 OnStartCompletedAsync(OK); |
| 326 } | 326 } |
| 327 | 327 |
| 328 UploadProgress URLRequestFtpJob::GetUploadProgress() const { | |
| 329 return UploadProgress(); | |
| 330 } | |
| 331 | |
| 332 int URLRequestFtpJob::ReadRawData(IOBuffer* buf, int buf_size) { | 328 int URLRequestFtpJob::ReadRawData(IOBuffer* buf, int buf_size) { |
| 333 DCHECK_NE(buf_size, 0); | 329 DCHECK_NE(buf_size, 0); |
| 334 DCHECK(!read_in_progress_); | 330 DCHECK(!read_in_progress_); |
| 335 | 331 |
| 336 int rv; | 332 int rv; |
| 337 | 333 |
| 338 if (proxy_info_.is_direct()) { | 334 if (proxy_info_.is_direct()) { |
| 339 rv = ftp_transaction_->Read(buf, buf_size, | 335 rv = ftp_transaction_->Read(buf, buf_size, |
| 340 base::Bind(&URLRequestFtpJob::OnReadCompleted, | 336 base::Bind(&URLRequestFtpJob::OnReadCompleted, |
| 341 base::Unretained(this))); | 337 base::Unretained(this))); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 372 if (cached_auth) { | 368 if (cached_auth) { |
| 373 // Retry using cached auth data. | 369 // Retry using cached auth data. |
| 374 SetAuth(cached_auth->credentials); | 370 SetAuth(cached_auth->credentials); |
| 375 } else { | 371 } else { |
| 376 // Prompt for a username/password. | 372 // Prompt for a username/password. |
| 377 NotifyHeadersComplete(); | 373 NotifyHeadersComplete(); |
| 378 } | 374 } |
| 379 } | 375 } |
| 380 | 376 |
| 381 } // namespace net | 377 } // namespace net |
| OLD | NEW |