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.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" |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 | 35 |
36 // static | 36 // static |
37 URLRequestJob* URLRequestFtpJob::Factory(URLRequest* request, | 37 URLRequestJob* URLRequestFtpJob::Factory(URLRequest* request, |
38 const std::string& scheme) { | 38 const std::string& scheme) { |
39 DCHECK_EQ(scheme, "ftp"); | 39 DCHECK_EQ(scheme, "ftp"); |
40 | 40 |
41 int port = request->url().IntPort(); | 41 int port = request->url().IntPort(); |
42 if (request->url().has_port() && | 42 if (request->url().has_port() && |
43 !IsPortAllowedByFtp(port) && !IsPortAllowedByOverride(port)) { | 43 !IsPortAllowedByFtp(port) && !IsPortAllowedByOverride(port)) { |
44 return new URLRequestErrorJob(request, ERR_UNSAFE_PORT); | 44 return new URLRequestErrorJob(request, |
| 45 request->context()->network_delegate(), |
| 46 ERR_UNSAFE_PORT); |
45 } | 47 } |
46 | 48 |
47 return new URLRequestFtpJob(request, | 49 return new URLRequestFtpJob(request, |
48 request->context()->network_delegate(), | 50 request->context()->network_delegate(), |
49 request->context()->ftp_transaction_factory(), | 51 request->context()->ftp_transaction_factory(), |
50 request->context()->ftp_auth_cache()); | 52 request->context()->ftp_auth_cache()); |
51 } | 53 } |
52 | 54 |
53 bool URLRequestFtpJob::GetMimeType(std::string* mime_type) const { | 55 bool URLRequestFtpJob::GetMimeType(std::string* mime_type) const { |
54 if (transaction_->GetResponseInfo()->is_directory_listing) { | 56 if (transaction_->GetResponseInfo()->is_directory_listing) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 if (rv == ERR_IO_PENDING) { | 254 if (rv == ERR_IO_PENDING) { |
253 read_in_progress_ = true; | 255 read_in_progress_ = true; |
254 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); | 256 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); |
255 } else { | 257 } else { |
256 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); | 258 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); |
257 } | 259 } |
258 return false; | 260 return false; |
259 } | 261 } |
260 | 262 |
261 } // namespace net | 263 } // namespace net |
OLD | NEW |