| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_new_ftp_job.h" | 5 #include "net/url_request/url_request_new_ftp_job.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 DCHECK(request_->context()->ftp_transaction_factory()); | 275 DCHECK(request_->context()->ftp_transaction_factory()); |
| 276 | 276 |
| 277 transaction_.reset( | 277 transaction_.reset( |
| 278 request_->context()->ftp_transaction_factory()->CreateTransaction()); | 278 request_->context()->ftp_transaction_factory()->CreateTransaction()); |
| 279 | 279 |
| 280 // No matter what, we want to report our status as IO pending since we will | 280 // No matter what, we want to report our status as IO pending since we will |
| 281 // be notifying our consumer asynchronously via OnStartCompleted. | 281 // be notifying our consumer asynchronously via OnStartCompleted. |
| 282 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); | 282 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); |
| 283 int rv; | 283 int rv; |
| 284 if (transaction_.get()) { | 284 if (transaction_.get()) { |
| 285 rv = transaction_->Start(&request_info_, &start_callback_); | 285 rv = transaction_->Start( |
| 286 request_->load_log(), &request_info_, &start_callback_); |
| 286 if (rv == net::ERR_IO_PENDING) | 287 if (rv == net::ERR_IO_PENDING) |
| 287 return; | 288 return; |
| 288 } else { | 289 } else { |
| 289 rv = net::ERR_FAILED; | 290 rv = net::ERR_FAILED; |
| 290 } | 291 } |
| 291 // The transaction started synchronously, but we need to notify the | 292 // The transaction started synchronously, but we need to notify the |
| 292 // URLRequest delegate via the message loop. | 293 // URLRequest delegate via the message loop. |
| 293 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 294 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
| 294 this, &URLRequestNewFtpJob::OnStartCompleted, rv)); | 295 this, &URLRequestNewFtpJob::OnStartCompleted, rv)); |
| 295 } | 296 } |
| 296 | 297 |
| 297 void URLRequestNewFtpJob::DestroyTransaction() { | 298 void URLRequestNewFtpJob::DestroyTransaction() { |
| 298 DCHECK(transaction_.get()); | 299 DCHECK(transaction_.get()); |
| 299 | 300 |
| 300 transaction_.reset(); | 301 transaction_.reset(); |
| 301 response_info_ = NULL; | 302 response_info_ = NULL; |
| 302 } | 303 } |
| OLD | NEW |