| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_FTP_FTP_TRANSACTION_H_ | 5 #ifndef NET_FTP_FTP_TRANSACTION_H_ |
| 6 #define NET_FTP_FTP_TRANSACTION_H_ | 6 #define NET_FTP_FTP_TRANSACTION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/string16.h" |
| 9 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| 10 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
| 11 #include "net/base/load_states.h" | 12 #include "net/base/load_states.h" |
| 12 | 13 |
| 13 namespace net { | 14 namespace net { |
| 14 | 15 |
| 15 class FtpResponseInfo; | 16 class FtpResponseInfo; |
| 16 class FtpRequestInfo; | 17 class FtpRequestInfo; |
| 17 class BoundNetLog; | 18 class BoundNetLog; |
| 18 | 19 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 35 // request_info object alive until Destroy is called on the transaction. | 36 // request_info object alive until Destroy is called on the transaction. |
| 36 // | 37 // |
| 37 // NOTE: The transaction is not responsible for deleting the callback object. | 38 // NOTE: The transaction is not responsible for deleting the callback object. |
| 38 // | 39 // |
| 39 // Profiling information for the request is saved to |net_log| if non-NULL. | 40 // Profiling information for the request is saved to |net_log| if non-NULL. |
| 40 virtual int Start(const FtpRequestInfo* request_info, | 41 virtual int Start(const FtpRequestInfo* request_info, |
| 41 CompletionCallback* callback, | 42 CompletionCallback* callback, |
| 42 const BoundNetLog& net_log) = 0; | 43 const BoundNetLog& net_log) = 0; |
| 43 | 44 |
| 44 // Restarts the FTP transaction with authentication credentials. | 45 // Restarts the FTP transaction with authentication credentials. |
| 45 virtual int RestartWithAuth(const std::wstring& username, | 46 virtual int RestartWithAuth(const string16& username, |
| 46 const std::wstring& password, | 47 const string16& password, |
| 47 CompletionCallback* callback) = 0; | 48 CompletionCallback* callback) = 0; |
| 48 | 49 |
| 49 // Once response info is available for the transaction, response data may be | 50 // Once response info is available for the transaction, response data may be |
| 50 // read by calling this method. | 51 // read by calling this method. |
| 51 // | 52 // |
| 52 // Response data is copied into the given buffer and the number of bytes | 53 // Response data is copied into the given buffer and the number of bytes |
| 53 // copied is returned. ERR_IO_PENDING is returned if response data is not | 54 // copied is returned. ERR_IO_PENDING is returned if response data is not |
| 54 // yet available. The CompletionCallback is notified when the data copy | 55 // yet available. The CompletionCallback is notified when the data copy |
| 55 // completes, and it is passed the number of bytes that were successfully | 56 // completes, and it is passed the number of bytes that were successfully |
| 56 // copied. Or, if a read error occurs, the CompletionCallback is notified of | 57 // copied. Or, if a read error occurs, the CompletionCallback is notified of |
| (...skipping 14 matching lines...) Expand all Loading... |
| 71 virtual LoadState GetLoadState() const = 0; | 72 virtual LoadState GetLoadState() const = 0; |
| 72 | 73 |
| 73 // Returns the upload progress in bytes. If there is no upload data, | 74 // Returns the upload progress in bytes. If there is no upload data, |
| 74 // zero will be returned. | 75 // zero will be returned. |
| 75 virtual uint64 GetUploadProgress() const = 0; | 76 virtual uint64 GetUploadProgress() const = 0; |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace net | 79 } // namespace net |
| 79 | 80 |
| 80 #endif // NET_FTP_FTP_TRANSACTION_H_ | 81 #endif // NET_FTP_FTP_TRANSACTION_H_ |
| OLD | NEW |