Chromium Code Reviews| 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 #ifndef NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "net/base/auth.h" | 12 #include "net/base/auth.h" |
| 13 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
| 14 #include "net/ftp/ftp_request_info.h" | 14 #include "net/ftp/ftp_request_info.h" |
| 15 #include "net/ftp/ftp_transaction.h" | 15 #include "net/ftp/ftp_transaction.h" |
| 16 #include "net/url_request/url_request_job.h" | 16 #include "net/url_request/url_request_job.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 class NetworkDelegate; | |
| 21 class FtpTransactionFactory; | |
| 22 class FtpAuthCache; | |
| 20 class URLRequestContext; | 23 class URLRequestContext; |
|
mmenke
2012/06/27 17:20:07
While you're here, can you remove the URLRequestC
shalev
2012/06/27 20:10:43
Done.
| |
| 21 | 24 |
| 22 // A URLRequestJob subclass that is built on top of FtpTransaction. It | 25 // A URLRequestJob subclass that is built on top of FtpTransaction. It |
| 23 // provides an implementation for FTP. | 26 // provides an implementation for FTP. |
| 24 class URLRequestFtpJob : public URLRequestJob { | 27 class URLRequestFtpJob : public URLRequestJob { |
| 25 public: | 28 public: |
| 26 explicit URLRequestFtpJob(URLRequest* request); | 29 URLRequestFtpJob(URLRequest* request, |
| 30 NetworkDelegate* network_delegate, | |
| 31 FtpTransactionFactory* ftp_transaction_factory, | |
| 32 FtpAuthCache* ftp_auth_cache); | |
| 27 | 33 |
| 34 // TODO(shalev): get rid of this function in favor of FtpProtocolHandler. | |
| 28 static URLRequestJob* Factory(URLRequest* request, | 35 static URLRequestJob* Factory(URLRequest* request, |
| 29 const std::string& scheme); | 36 const std::string& scheme); |
| 30 | 37 |
| 31 // Overridden from URLRequestJob: | 38 // Overridden from URLRequestJob: |
| 32 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; | 39 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; |
| 33 virtual HostPortPair GetSocketAddress() const OVERRIDE; | 40 virtual HostPortPair GetSocketAddress() const OVERRIDE; |
| 34 | 41 |
| 35 private: | 42 private: |
| 36 virtual ~URLRequestFtpJob(); | 43 virtual ~URLRequestFtpJob(); |
| 37 | 44 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 62 | 69 |
| 63 FtpRequestInfo request_info_; | 70 FtpRequestInfo request_info_; |
| 64 scoped_ptr<FtpTransaction> transaction_; | 71 scoped_ptr<FtpTransaction> transaction_; |
| 65 | 72 |
| 66 bool read_in_progress_; | 73 bool read_in_progress_; |
| 67 | 74 |
| 68 scoped_refptr<AuthData> server_auth_; | 75 scoped_refptr<AuthData> server_auth_; |
| 69 | 76 |
| 70 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; | 77 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; |
| 71 | 78 |
| 79 FtpTransactionFactory* ftp_transaction_factory_; | |
| 80 FtpAuthCache* ftp_auth_cache_; | |
| 81 | |
| 72 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); | 82 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); |
| 73 }; | 83 }; |
| 74 | 84 |
| 75 } // namespace net | 85 } // namespace net |
| 76 | 86 |
| 77 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 87 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
| OLD | NEW |