| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
| 11 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
| 14 #include "net/ftp/ftp_response_info.h" | 14 #include "net/ftp/ftp_response_info.h" |
| 15 #include "net/ftp/ftp_transaction_factory.h" | 15 #include "net/ftp/ftp_transaction_factory.h" |
| 16 #include "net/url_request/url_request.h" | 16 #include "net/url_request/url_request.h" |
| 17 #include "net/url_request/url_request_context.h" | 17 #include "net/url_request/url_request_context.h" |
| 18 #include "net/url_request/url_request_error_job.h" | 18 #include "net/url_request/url_request_error_job.h" |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 URLRequestFtpJob::URLRequestFtpJob(URLRequest* request) | 22 URLRequestFtpJob::URLRequestFtpJob(URLRequest* request) |
| 23 : URLRequestJob(request), | 23 : URLRequestJob(request), |
| 24 read_in_progress_(false), | 24 read_in_progress_(false), |
| 25 context_(request->context()), | |
| 26 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 25 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
| 27 } | 26 } |
| 28 | 27 |
| 29 // static | 28 // static |
| 30 URLRequestJob* URLRequestFtpJob::Factory(URLRequest* request, | 29 URLRequestJob* URLRequestFtpJob::Factory(URLRequest* request, |
| 31 const std::string& scheme) { | 30 const std::string& scheme) { |
| 32 DCHECK_EQ(scheme, "ftp"); | 31 DCHECK_EQ(scheme, "ftp"); |
| 33 | 32 |
| 34 int port = request->url().IntPort(); | 33 int port = request->url().IntPort(); |
| 35 if (request->url().has_port() && | 34 if (request->url().has_port() && |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (rv == ERR_IO_PENDING) { | 245 if (rv == ERR_IO_PENDING) { |
| 247 read_in_progress_ = true; | 246 read_in_progress_ = true; |
| 248 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); | 247 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); |
| 249 } else { | 248 } else { |
| 250 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 249 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
| 251 } | 250 } |
| 252 return false; | 251 return false; |
| 253 } | 252 } |
| 254 | 253 |
| 255 } // namespace net | 254 } // namespace net |
| OLD | NEW |