Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/url_request/url_request_inet_job.h" | 10 #include "net/url_request/url_request_inet_job.h" |
| 11 | 11 |
| 12 // A basic FTP job that handles download files and showing directory listings. | 12 // A basic FTP job that handles download files and showing directory listings. |
| 13 class URLRequestFtpJob : public URLRequestInetJob { | 13 class URLRequestFtpJob : public URLRequestInetJob { |
| 14 public: | 14 public: |
| 15 static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); | 15 static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); |
| 16 | 16 |
| 17 virtual ~URLRequestFtpJob(); | |
| 18 | |
| 19 // URLRequestJob methods: | 17 // URLRequestJob methods: |
| 20 virtual void Start(); | 18 virtual void Start(); |
| 21 virtual bool GetMimeType(std::string* mime_type) const; | 19 virtual bool GetMimeType(std::string* mime_type) const; |
| 22 | 20 |
| 23 // URLRequestInetJob methods: | 21 // URLRequestInetJob methods: |
| 24 virtual void OnIOComplete(const AsyncResult& result); | 22 virtual void OnIOComplete(const AsyncResult& result); |
| 25 | 23 |
| 26 protected: | 24 protected: |
| 27 explicit URLRequestFtpJob(URLRequest* request); | 25 explicit URLRequestFtpJob(URLRequest* request); |
| 28 | 26 |
| 29 // Starts the WinInet request. | 27 // Starts the WinInet request. |
| 30 virtual void SendRequest(); | 28 virtual void SendRequest(); |
| 31 | 29 |
| 32 virtual int CallInternetRead(char* dest, int dest_size, int *bytes_read); | 30 virtual int CallInternetRead(char* dest, int dest_size, int *bytes_read); |
| 33 virtual bool GetReadBytes(const AsyncResult& result, int* bytes_read); | 31 virtual bool GetReadBytes(const AsyncResult& result, int* bytes_read); |
| 34 virtual void OnCancelAuth(); | 32 virtual void OnCancelAuth(); |
| 35 virtual void OnSetAuth(); | 33 virtual void OnSetAuth(); |
| 36 virtual bool NeedsAuth(); | 34 virtual bool NeedsAuth(); |
| 37 virtual void GetAuthChallengeInfo(scoped_refptr<net::AuthChallengeInfo>*); | 35 virtual void GetAuthChallengeInfo(scoped_refptr<net::AuthChallengeInfo>*); |
| 38 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); | 36 virtual bool IsRedirectResponse(GURL* location, int* http_status_code); |
| 39 | 37 |
| 40 private: | 38 private: |
| 39 ~URLRequestFtpJob(); | |
|
eroman
2009/11/05 20:52:19
was it intentional to remove the virtual keyword?
jam
2009/11/05 21:56:02
it wasn't needed, but I'll keep it the way it was
| |
| 40 | |
| 41 // Called after InternetConnect successfully connects to server. | 41 // Called after InternetConnect successfully connects to server. |
| 42 void OnConnect(); | 42 void OnConnect(); |
| 43 | 43 |
| 44 // Called after FtpSetCurrentDirectory attempts to change current dir. | 44 // Called after FtpSetCurrentDirectory attempts to change current dir. |
| 45 void OnSetCurrentDirectory(DWORD last_error); | 45 void OnSetCurrentDirectory(DWORD last_error); |
| 46 | 46 |
| 47 // Requests the next file in the directory listing from WinInet. | 47 // Requests the next file in the directory listing from WinInet. |
| 48 void FindNextFile(); | 48 void FindNextFile(); |
| 49 | 49 |
| 50 // Called when the first file in a directory listing is available. | 50 // Called when the first file in a directory listing is available. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 // buffer in between the time a Read() call comes in and we get the file | 107 // buffer in between the time a Read() call comes in and we get the file |
| 108 // entry from WinInet. | 108 // entry from WinInet. |
| 109 char* dest_; | 109 char* dest_; |
| 110 int dest_size_; | 110 int dest_size_; |
| 111 | 111 |
| 112 | 112 |
| 113 DISALLOW_EVIL_CONSTRUCTORS(URLRequestFtpJob); | 113 DISALLOW_EVIL_CONSTRUCTORS(URLRequestFtpJob); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 116 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
| OLD | NEW |