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 ListState; | 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(); | 29 virtual ~URLRequestNewFtpJob(); |
(...skipping 19 matching lines...) Expand all Loading... |
49 void DestroyTransaction(); | 49 void DestroyTransaction(); |
50 void StartTransaction(); | 50 void StartTransaction(); |
51 | 51 |
52 void OnStartCompleted(int result); | 52 void OnStartCompleted(int result); |
53 void OnReadCompleted(int result); | 53 void OnReadCompleted(int result); |
54 | 54 |
55 void RestartTransactionWithAuth(); | 55 void RestartTransactionWithAuth(); |
56 | 56 |
57 int ProcessFtpDir(net::IOBuffer *buf, int buf_size, int bytes_read); | 57 int ProcessFtpDir(net::IOBuffer *buf, int buf_size, int bytes_read); |
58 | 58 |
59 void LogFtpServerType(const net::ListState& list_state); | 59 void LogFtpServerType(const struct net::list_state& list_state); |
60 | 60 |
61 net::FtpRequestInfo request_info_; | 61 net::FtpRequestInfo request_info_; |
62 scoped_ptr<net::FtpTransaction> transaction_; | 62 scoped_ptr<net::FtpTransaction> transaction_; |
63 const net::FtpResponseInfo* response_info_; | 63 const net::FtpResponseInfo* response_info_; |
64 | 64 |
65 scoped_refptr<net::IOBuffer> dir_listing_buf_; | 65 scoped_refptr<net::IOBuffer> dir_listing_buf_; |
66 int dir_listing_buf_size_; | 66 int dir_listing_buf_size_; |
67 | 67 |
68 net::CompletionCallbackImpl<URLRequestNewFtpJob> start_callback_; | 68 net::CompletionCallbackImpl<URLRequestNewFtpJob> start_callback_; |
69 net::CompletionCallbackImpl<URLRequestNewFtpJob> read_callback_; | 69 net::CompletionCallbackImpl<URLRequestNewFtpJob> read_callback_; |
70 | 70 |
71 std::string directory_html_; | 71 std::string directory_html_; |
72 bool read_in_progress_; | 72 bool read_in_progress_; |
73 std::string encoding_; | 73 std::string encoding_; |
74 | 74 |
75 scoped_refptr<net::AuthData> server_auth_; | 75 scoped_refptr<net::AuthData> server_auth_; |
76 | 76 |
77 // Keep a reference to the url request context to be sure it's not deleted | 77 // Keep a reference to the url request context to be sure it's not deleted |
78 // before us. | 78 // before us. |
79 scoped_refptr<URLRequestContext> context_; | 79 scoped_refptr<URLRequestContext> context_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(URLRequestNewFtpJob); | 81 DISALLOW_COPY_AND_ASSIGN(URLRequestNewFtpJob); |
82 }; | 82 }; |
83 | 83 |
84 #endif // NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ | 84 #endif // NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ |
OLD | NEW |