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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "net/base/auth.h" | 9 #include "net/base/auth.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 transaction_.reset( | 219 transaction_.reset( |
220 request_->context()->ftp_transaction_factory()->CreateTransaction()); | 220 request_->context()->ftp_transaction_factory()->CreateTransaction()); |
221 | 221 |
222 // No matter what, we want to report our status as IO pending since we will | 222 // No matter what, we want to report our status as IO pending since we will |
223 // be notifying our consumer asynchronously via OnStartCompleted. | 223 // be notifying our consumer asynchronously via OnStartCompleted. |
224 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); | 224 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); |
225 int rv; | 225 int rv; |
226 if (transaction_.get()) { | 226 if (transaction_.get()) { |
227 rv = transaction_->Start( | 227 rv = transaction_->Start( |
228 &request_info_, &start_callback_, request_->load_log()); | 228 &request_info_, &start_callback_, request_->net_log()); |
229 if (rv == net::ERR_IO_PENDING) | 229 if (rv == net::ERR_IO_PENDING) |
230 return; | 230 return; |
231 } else { | 231 } else { |
232 rv = net::ERR_FAILED; | 232 rv = net::ERR_FAILED; |
233 } | 233 } |
234 // The transaction started synchronously, but we need to notify the | 234 // The transaction started synchronously, but we need to notify the |
235 // URLRequest delegate via the message loop. | 235 // URLRequest delegate via the message loop. |
236 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 236 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
237 this, &URLRequestNewFtpJob::OnStartCompleted, rv)); | 237 this, &URLRequestNewFtpJob::OnStartCompleted, rv)); |
238 } | 238 } |
239 | 239 |
240 void URLRequestNewFtpJob::DestroyTransaction() { | 240 void URLRequestNewFtpJob::DestroyTransaction() { |
241 DCHECK(transaction_.get()); | 241 DCHECK(transaction_.get()); |
242 | 242 |
243 transaction_.reset(); | 243 transaction_.reset(); |
244 } | 244 } |
OLD | NEW |