Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: net/ftp/ftp_transaction.h

Issue 39130: FTP Transaction code for new Portable FTP(Patch SET-3) (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/ftp/ftp_response_info.h ('k') | net/url_request/url_request_new_ftp_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_TRANSACTION_H_ 5 #ifndef NET_FTP_FTP_TRANSACTION_H_
6 #define NET_FTP_FTP_TRANSACTION_H_ 6 #define NET_FTP_FTP_TRANSACTION_H_
7 7
8 #include "net/base/completion_callback.h" 8 #include "net/base/completion_callback.h"
9 #include "net/base/io_buffer.h"
9 #include "net/base/load_states.h" 10 #include "net/base/load_states.h"
10 11
12
11 namespace net { 13 namespace net {
12 14
13 class FtpRequestInfo; 15 class FtpRequestInfo;
14 class FtpResponseInfo; 16 class FtpResponseInfo;
15
16 // Represents a single FTP transaction. 17 // Represents a single FTP transaction.
17 class FtpTransaction { 18 class FtpTransaction {
18 public: 19 public:
19 // Stops any pending IO and destroys the transaction object. 20 // Stops any pending IO and destroys the transaction object.
20 virtual void Destroy() = 0; 21 virtual ~FtpTransaction() {}
21 22
22 // Starts the FTP transaction (i.e., sends the FTP request). 23 // Starts the FTP transaction (i.e., sends the FTP request).
23 // 24 //
24 // Returns OK if the transaction could be started synchronously, which means 25 // Returns OK if the transaction could be started synchronously, which means
25 // that the request was served from the cache (only supported for directory 26 // that the request was served from the cache (only supported for directory
26 // listings). ERR_IO_PENDING is returned to indicate that the 27 // listings). ERR_IO_PENDING is returned to indicate that the
27 // CompletionCallback will be notified once response info is available or if 28 // CompletionCallback will be notified once response info is available or if
28 // an IO error occurs. Any other return value indicates that the transaction 29 // an IO error occurs. Any other return value indicates that the transaction
29 // could not be started. 30 // could not be started.
30 // 31 //
(...skipping 16 matching lines...) Expand all
47 // Response data is copied into the given buffer and the number of bytes 48 // Response data is copied into the given buffer and the number of bytes
48 // copied is returned. ERR_IO_PENDING is returned if response data is not 49 // copied is returned. ERR_IO_PENDING is returned if response data is not
49 // yet available. The CompletionCallback is notified when the data copy 50 // yet available. The CompletionCallback is notified when the data copy
50 // completes, and it is passed the number of bytes that were successfully 51 // completes, and it is passed the number of bytes that were successfully
51 // copied. Or, if a read error occurs, the CompletionCallback is notified of 52 // copied. Or, if a read error occurs, the CompletionCallback is notified of
52 // the error. Any other negative return value indicates that the transaction 53 // the error. Any other negative return value indicates that the transaction
53 // could not be read. 54 // could not be read.
54 // 55 //
55 // NOTE: The transaction is not responsible for deleting the callback object. 56 // NOTE: The transaction is not responsible for deleting the callback object.
56 // 57 //
57 virtual int Read(char* buf, int buf_len, CompletionCallback* callback) = 0; 58 virtual int Read(IOBuffer* buf, int buf_len,
59 CompletionCallback* callback) = 0;
58 60
59 // Returns the response info for this transaction or NULL if the response 61 // Returns the response info for this transaction or NULL if the response
60 // info is not available. 62 // info is not available.
61 virtual const FtpResponseInfo* GetResponseInfo() const = 0; 63 virtual const FtpResponseInfo* GetResponseInfo() const = 0;
62 64
63 // Returns the load state for this transaction. 65 // Returns the load state for this transaction.
64 virtual LoadState GetLoadState() const = 0; 66 virtual LoadState GetLoadState() const = 0;
65 67
66 // Returns the upload progress in bytes. If there is no upload data, 68 // Returns the upload progress in bytes. If there is no upload data,
67 // zero will be returned. This does not include the request headers. 69 // zero will be returned.
68 virtual uint64 GetUploadProgress() const = 0; 70 virtual uint64 GetUploadProgress() const = 0;
69 }; 71 };
70 72
71 } // namespace net 73 } // namespace net
72 74
73 #endif // NET_FTP_FTP_TRANSACTION_H_ 75 #endif // NET_FTP_FTP_TRANSACTION_H_
OLDNEW
« no previous file with comments | « net/ftp/ftp_response_info.h ('k') | net/url_request/url_request_new_ftp_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698