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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // A URLRequestJob subclass that is built on top of FtpTransaction. It | 27 // A URLRequestJob subclass that is built on top of FtpTransaction. It |
28 // provides an implementation for FTP. | 28 // provides an implementation for FTP. |
29 class NET_EXPORT_PRIVATE URLRequestFtpJob : public URLRequestJob { | 29 class NET_EXPORT_PRIVATE URLRequestFtpJob : public URLRequestJob { |
30 public: | 30 public: |
31 URLRequestFtpJob(URLRequest* request, | 31 URLRequestFtpJob(URLRequest* request, |
32 NetworkDelegate* network_delegate, | 32 NetworkDelegate* network_delegate, |
33 FtpTransactionFactory* ftp_transaction_factory, | 33 FtpTransactionFactory* ftp_transaction_factory, |
34 FtpAuthCache* ftp_auth_cache); | 34 FtpAuthCache* ftp_auth_cache); |
35 | 35 |
36 protected: | 36 protected: |
37 virtual ~URLRequestFtpJob(); | 37 ~URLRequestFtpJob() override; |
38 | 38 |
39 // Overridden from URLRequestJob: | 39 // Overridden from URLRequestJob: |
40 virtual bool IsSafeRedirect(const GURL& location) override; | 40 bool IsSafeRedirect(const GURL& location) override; |
41 virtual bool GetMimeType(std::string* mime_type) const override; | 41 bool GetMimeType(std::string* mime_type) const override; |
42 virtual void GetResponseInfo(HttpResponseInfo* info) override; | 42 void GetResponseInfo(HttpResponseInfo* info) override; |
43 virtual HostPortPair GetSocketAddress() const override; | 43 HostPortPair GetSocketAddress() const override; |
44 virtual void SetPriority(RequestPriority priority) override; | 44 void SetPriority(RequestPriority priority) override; |
45 virtual void Start() override; | 45 void Start() override; |
46 virtual void Kill() override; | 46 void Kill() override; |
47 | 47 |
48 RequestPriority priority() const { return priority_; } | 48 RequestPriority priority() const { return priority_; } |
49 | 49 |
50 private: | 50 private: |
51 void OnResolveProxyComplete(int result); | 51 void OnResolveProxyComplete(int result); |
52 | 52 |
53 void StartFtpTransaction(); | 53 void StartFtpTransaction(); |
54 void StartHttpTransaction(); | 54 void StartHttpTransaction(); |
55 | 55 |
56 void OnStartCompleted(int result); | 56 void OnStartCompleted(int result); |
57 void OnStartCompletedAsync(int result); | 57 void OnStartCompletedAsync(int result); |
58 void OnReadCompleted(int result); | 58 void OnReadCompleted(int result); |
59 | 59 |
60 void RestartTransactionWithAuth(); | 60 void RestartTransactionWithAuth(); |
61 | 61 |
62 void LogFtpServerType(char server_type); | 62 void LogFtpServerType(char server_type); |
63 | 63 |
64 // Overridden from URLRequestJob: | 64 // Overridden from URLRequestJob: |
65 virtual LoadState GetLoadState() const override; | 65 LoadState GetLoadState() const override; |
66 virtual bool NeedsAuth() override; | 66 bool NeedsAuth() override; |
67 virtual void GetAuthChallengeInfo( | 67 void GetAuthChallengeInfo( |
68 scoped_refptr<AuthChallengeInfo>* auth_info) override; | 68 scoped_refptr<AuthChallengeInfo>* auth_info) override; |
69 virtual void SetAuth(const AuthCredentials& credentials) override; | 69 void SetAuth(const AuthCredentials& credentials) override; |
70 virtual void CancelAuth() override; | 70 void CancelAuth() override; |
71 | 71 |
72 // TODO(ibrar): Yet to give another look at this function. | 72 // TODO(ibrar): Yet to give another look at this function. |
73 virtual UploadProgress GetUploadProgress() const override; | 73 UploadProgress GetUploadProgress() const override; |
74 virtual bool ReadRawData(IOBuffer* buf, | 74 bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override; |
75 int buf_size, | |
76 int *bytes_read) override; | |
77 | 75 |
78 void HandleAuthNeededResponse(); | 76 void HandleAuthNeededResponse(); |
79 | 77 |
80 RequestPriority priority_; | 78 RequestPriority priority_; |
81 | 79 |
82 ProxyService* proxy_service_; | 80 ProxyService* proxy_service_; |
83 ProxyInfo proxy_info_; | 81 ProxyInfo proxy_info_; |
84 ProxyService::PacRequest* pac_request_; | 82 ProxyService::PacRequest* pac_request_; |
85 | 83 |
86 FtpRequestInfo ftp_request_info_; | 84 FtpRequestInfo ftp_request_info_; |
(...skipping 11 matching lines...) Expand all Loading... |
98 FtpAuthCache* ftp_auth_cache_; | 96 FtpAuthCache* ftp_auth_cache_; |
99 | 97 |
100 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; | 98 base::WeakPtrFactory<URLRequestFtpJob> weak_factory_; |
101 | 99 |
102 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); | 100 DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); |
103 }; | 101 }; |
104 | 102 |
105 } // namespace net | 103 } // namespace net |
106 | 104 |
107 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ | 105 #endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ |
OLD | NEW |