| 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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/profiler/scoped_tracker.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 10 #include "net/base/auth.h" | 11 #include "net/base/auth.h" |
| 11 #include "net/base/host_port_pair.h" | 12 #include "net/base/host_port_pair.h" |
| 12 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
| 13 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 14 #include "net/base/net_util.h" | 15 #include "net/base/net_util.h" |
| 15 #include "net/ftp/ftp_auth_cache.h" | 16 #include "net/ftp/ftp_auth_cache.h" |
| 16 #include "net/ftp/ftp_response_info.h" | 17 #include "net/ftp/ftp_response_info.h" |
| 17 #include "net/ftp/ftp_transaction_factory.h" | 18 #include "net/ftp/ftp_transaction_factory.h" |
| 18 #include "net/http/http_response_headers.h" | 19 #include "net/http/http_response_headers.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 OnStartCompletedAsync(OK); | 343 OnStartCompletedAsync(OK); |
| 343 } | 344 } |
| 344 | 345 |
| 345 UploadProgress URLRequestFtpJob::GetUploadProgress() const { | 346 UploadProgress URLRequestFtpJob::GetUploadProgress() const { |
| 346 return UploadProgress(); | 347 return UploadProgress(); |
| 347 } | 348 } |
| 348 | 349 |
| 349 bool URLRequestFtpJob::ReadRawData(IOBuffer* buf, | 350 bool URLRequestFtpJob::ReadRawData(IOBuffer* buf, |
| 350 int buf_size, | 351 int buf_size, |
| 351 int *bytes_read) { | 352 int *bytes_read) { |
| 353 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed. |
| 354 tracked_objects::ScopedTracker tracking_profile( |
| 355 FROM_HERE_WITH_EXPLICIT_FUNCTION("423948 URLRequestFtpJob::ReadRawData")); |
| 356 |
| 352 DCHECK_NE(buf_size, 0); | 357 DCHECK_NE(buf_size, 0); |
| 353 DCHECK(bytes_read); | 358 DCHECK(bytes_read); |
| 354 DCHECK(!read_in_progress_); | 359 DCHECK(!read_in_progress_); |
| 355 | 360 |
| 356 int rv; | 361 int rv; |
| 357 if (proxy_info_.is_direct()) { | 362 if (proxy_info_.is_direct()) { |
| 358 rv = ftp_transaction_->Read(buf, buf_size, | 363 rv = ftp_transaction_->Read(buf, buf_size, |
| 359 base::Bind(&URLRequestFtpJob::OnReadCompleted, | 364 base::Bind(&URLRequestFtpJob::OnReadCompleted, |
| 360 base::Unretained(this))); | 365 base::Unretained(this))); |
| 361 } else { | 366 } else { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 if (cached_auth) { | 405 if (cached_auth) { |
| 401 // Retry using cached auth data. | 406 // Retry using cached auth data. |
| 402 SetAuth(cached_auth->credentials); | 407 SetAuth(cached_auth->credentials); |
| 403 } else { | 408 } else { |
| 404 // Prompt for a username/password. | 409 // Prompt for a username/password. |
| 405 NotifyHeadersComplete(); | 410 NotifyHeadersComplete(); |
| 406 } | 411 } |
| 407 } | 412 } |
| 408 | 413 |
| 409 } // namespace net | 414 } // namespace net |
| OLD | NEW |