| 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 #ifndef NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
| 11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
| 12 #include "net/ftp/ftp_request_info.h" | 12 #include "net/ftp/ftp_request_info.h" |
| 13 #include "net/ftp/ftp_transaction.h" | 13 #include "net/ftp/ftp_transaction.h" |
| 14 #include "net/url_request/url_request_job.h" | 14 #include "net/url_request/url_request_job.h" |
| 15 | 15 |
| 16 class URLRequestContext; | 16 class URLRequestContext; |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 struct list_state; | 19 struct list_state; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // A URLRequestJob subclass that is built on top of FtpTransaction. It | 22 // A URLRequestJob subclass that is built on top of FtpTransaction. It |
| 23 // provides an implementation for FTP. | 23 // provides an implementation for FTP. |
| 24 class URLRequestNewFtpJob : public URLRequestJob { | 24 class URLRequestNewFtpJob : public URLRequestJob { |
| 25 public: | 25 public: |
| 26 | 26 |
| 27 explicit URLRequestNewFtpJob(URLRequest* request); | 27 explicit URLRequestNewFtpJob(URLRequest* request); |
| 28 | 28 |
| 29 virtual ~URLRequestNewFtpJob(); | |
| 30 | |
| 31 static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); | 29 static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); |
| 32 | 30 |
| 33 // URLRequestJob methods: | 31 // URLRequestJob methods: |
| 34 virtual bool GetMimeType(std::string* mime_type) const; | 32 virtual bool GetMimeType(std::string* mime_type) const; |
| 35 | 33 |
| 36 private: | 34 private: |
| 35 virtual ~URLRequestNewFtpJob(); |
| 36 |
| 37 // URLRequestJob methods: | 37 // URLRequestJob methods: |
| 38 virtual void Start(); | 38 virtual void Start(); |
| 39 virtual void Kill(); | 39 virtual void Kill(); |
| 40 virtual net::LoadState GetLoadState() const; | 40 virtual net::LoadState GetLoadState() const; |
| 41 virtual bool NeedsAuth(); | 41 virtual bool NeedsAuth(); |
| 42 virtual void GetAuthChallengeInfo( | 42 virtual void GetAuthChallengeInfo( |
| 43 scoped_refptr<net::AuthChallengeInfo>* auth_info); | 43 scoped_refptr<net::AuthChallengeInfo>* auth_info); |
| 44 virtual void SetAuth(const std::wstring& username, | 44 virtual void SetAuth(const std::wstring& username, |
| 45 const std::wstring& password); | 45 const std::wstring& password); |
| 46 virtual void CancelAuth(); | 46 virtual void CancelAuth(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 70 scoped_refptr<net::AuthData> server_auth_; | 70 scoped_refptr<net::AuthData> server_auth_; |
| 71 | 71 |
| 72 // Keep a reference to the url request context to be sure it's not deleted | 72 // Keep a reference to the url request context to be sure it's not deleted |
| 73 // before us. | 73 // before us. |
| 74 scoped_refptr<URLRequestContext> context_; | 74 scoped_refptr<URLRequestContext> context_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(URLRequestNewFtpJob); | 76 DISALLOW_COPY_AND_ASSIGN(URLRequestNewFtpJob); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ | 79 #endif // NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ |
| OLD | NEW |