OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #ifndef NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
6 #define NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 6 #define NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "net/base/address_list.h" | 15 #include "net/base/address_list.h" |
16 #include "net/base/host_resolver.h" | 16 #include "net/base/host_resolver.h" |
| 17 #include "net/base/net_log.h" |
17 #include "net/ftp/ftp_ctrl_response_buffer.h" | 18 #include "net/ftp/ftp_ctrl_response_buffer.h" |
18 #include "net/ftp/ftp_response_info.h" | 19 #include "net/ftp/ftp_response_info.h" |
19 #include "net/ftp/ftp_transaction.h" | 20 #include "net/ftp/ftp_transaction.h" |
20 | 21 |
21 namespace net { | 22 namespace net { |
22 | 23 |
23 class ClientSocket; | 24 class ClientSocket; |
24 class ClientSocketFactory; | 25 class ClientSocketFactory; |
25 class FtpNetworkSession; | 26 class FtpNetworkSession; |
26 | 27 |
27 class FtpNetworkTransaction : public FtpTransaction { | 28 class FtpNetworkTransaction : public FtpTransaction { |
28 public: | 29 public: |
29 FtpNetworkTransaction(FtpNetworkSession* session, | 30 FtpNetworkTransaction(FtpNetworkSession* session, |
30 ClientSocketFactory* socket_factory); | 31 ClientSocketFactory* socket_factory); |
31 virtual ~FtpNetworkTransaction(); | 32 virtual ~FtpNetworkTransaction(); |
32 | 33 |
33 // FtpTransaction methods: | 34 // FtpTransaction methods: |
34 virtual int Start(const FtpRequestInfo* request_info, | 35 virtual int Start(const FtpRequestInfo* request_info, |
35 CompletionCallback* callback, | 36 CompletionCallback* callback, |
36 LoadLog* load_log); | 37 const BoundNetLog& net_log); |
37 virtual int Stop(int error); | 38 virtual int Stop(int error); |
38 virtual int RestartWithAuth(const std::wstring& username, | 39 virtual int RestartWithAuth(const std::wstring& username, |
39 const std::wstring& password, | 40 const std::wstring& password, |
40 CompletionCallback* callback); | 41 CompletionCallback* callback); |
41 virtual int RestartIgnoringLastError(CompletionCallback* callback); | 42 virtual int RestartIgnoringLastError(CompletionCallback* callback); |
42 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 43 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
43 virtual const FtpResponseInfo* GetResponseInfo() const; | 44 virtual const FtpResponseInfo* GetResponseInfo() const; |
44 virtual LoadState GetLoadState() const; | 45 virtual LoadState GetLoadState() const; |
45 virtual uint64 GetUploadProgress() const; | 46 virtual uint64 GetUploadProgress() const; |
46 | 47 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 169 |
169 void RecordDataConnectionError(int result); | 170 void RecordDataConnectionError(int result); |
170 | 171 |
171 Command command_sent_; | 172 Command command_sent_; |
172 | 173 |
173 CompletionCallbackImpl<FtpNetworkTransaction> io_callback_; | 174 CompletionCallbackImpl<FtpNetworkTransaction> io_callback_; |
174 CompletionCallback* user_callback_; | 175 CompletionCallback* user_callback_; |
175 | 176 |
176 scoped_refptr<FtpNetworkSession> session_; | 177 scoped_refptr<FtpNetworkSession> session_; |
177 | 178 |
178 scoped_refptr<LoadLog> load_log_; | 179 BoundNetLog net_log_; |
179 const FtpRequestInfo* request_; | 180 const FtpRequestInfo* request_; |
180 FtpResponseInfo response_; | 181 FtpResponseInfo response_; |
181 | 182 |
182 // Cancels the outstanding request on destruction. | 183 // Cancels the outstanding request on destruction. |
183 SingleRequestHostResolver resolver_; | 184 SingleRequestHostResolver resolver_; |
184 AddressList addresses_; | 185 AddressList addresses_; |
185 | 186 |
186 // User buffer passed to the Read method for control socket. | 187 // User buffer passed to the Read method for control socket. |
187 scoped_refptr<IOBuffer> read_ctrl_buf_; | 188 scoped_refptr<IOBuffer> read_ctrl_buf_; |
188 | 189 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 STATE_DATA_READ, | 253 STATE_DATA_READ, |
253 STATE_DATA_READ_COMPLETE, | 254 STATE_DATA_READ_COMPLETE, |
254 STATE_NONE | 255 STATE_NONE |
255 }; | 256 }; |
256 State next_state_; | 257 State next_state_; |
257 }; | 258 }; |
258 | 259 |
259 } // namespace net | 260 } // namespace net |
260 | 261 |
261 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ | 262 #endif // NET_FTP_FTP_NETWORK_TRANSACTION_H_ |
OLD | NEW |