Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_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 "base/string16.h" |
|
asanka
2011/10/28 14:39:40
Not needed.
| |
| 10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| 11 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
| 12 #include "net/base/load_states.h" | 12 #include "net/base/load_states.h" |
| 13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 class AuthCredentials; | |
| 17 class FtpResponseInfo; | 18 class FtpResponseInfo; |
| 18 class FtpRequestInfo; | 19 class FtpRequestInfo; |
| 19 class BoundNetLog; | 20 class BoundNetLog; |
| 20 | 21 |
| 21 // Represents a single FTP transaction. | 22 // Represents a single FTP transaction. |
| 22 class NET_EXPORT_PRIVATE FtpTransaction { | 23 class NET_EXPORT_PRIVATE FtpTransaction { |
| 23 public: | 24 public: |
| 24 // Stops any pending IO and destroys the transaction object. | 25 // Stops any pending IO and destroys the transaction object. |
| 25 virtual ~FtpTransaction() {} | 26 virtual ~FtpTransaction() {} |
| 26 | 27 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 37 // request_info object alive until Destroy is called on the transaction. | 38 // request_info object alive until Destroy is called on the transaction. |
| 38 // | 39 // |
| 39 // NOTE: The transaction is not responsible for deleting the callback object. | 40 // NOTE: The transaction is not responsible for deleting the callback object. |
| 40 // | 41 // |
| 41 // Profiling information for the request is saved to |net_log| if non-NULL. | 42 // Profiling information for the request is saved to |net_log| if non-NULL. |
| 42 virtual int Start(const FtpRequestInfo* request_info, | 43 virtual int Start(const FtpRequestInfo* request_info, |
| 43 OldCompletionCallback* callback, | 44 OldCompletionCallback* callback, |
| 44 const BoundNetLog& net_log) = 0; | 45 const BoundNetLog& net_log) = 0; |
| 45 | 46 |
| 46 // Restarts the FTP transaction with authentication credentials. | 47 // Restarts the FTP transaction with authentication credentials. |
| 47 virtual int RestartWithAuth(const string16& username, | 48 virtual int RestartWithAuth(const AuthCredentials& credentials, |
| 48 const string16& password, | |
| 49 OldCompletionCallback* callback) = 0; | 49 OldCompletionCallback* callback) = 0; |
| 50 | 50 |
| 51 // Once response info is available for the transaction, response data may be | 51 // Once response info is available for the transaction, response data may be |
| 52 // read by calling this method. | 52 // read by calling this method. |
| 53 // | 53 // |
| 54 // Response data is copied into the given buffer and the number of bytes | 54 // Response data is copied into the given buffer and the number of bytes |
| 55 // copied is returned. ERR_IO_PENDING is returned if response data is not | 55 // copied is returned. ERR_IO_PENDING is returned if response data is not |
| 56 // yet available. The OldCompletionCallback is notified when the data copy | 56 // yet available. The OldCompletionCallback is notified when the data copy |
| 57 // completes, and it is passed the number of bytes that were successfully | 57 // completes, and it is passed the number of bytes that were successfully |
| 58 // copied. Or, if a read error occurs, the OldCompletionCallback is notified of | 58 // copied. Or, if a read error occurs, the OldCompletionCallback is notified of |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 73 virtual LoadState GetLoadState() const = 0; | 73 virtual LoadState GetLoadState() const = 0; |
| 74 | 74 |
| 75 // Returns the upload progress in bytes. If there is no upload data, | 75 // Returns the upload progress in bytes. If there is no upload data, |
| 76 // zero will be returned. | 76 // zero will be returned. |
| 77 virtual uint64 GetUploadProgress() const = 0; | 77 virtual uint64 GetUploadProgress() const = 0; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace net | 80 } // namespace net |
| 81 | 81 |
| 82 #endif // NET_FTP_FTP_TRANSACTION_H_ | 82 #endif // NET_FTP_FTP_TRANSACTION_H_ |
| OLD | NEW |