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

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

Issue 848006: Generalize the net module's LoadLog facility from a passive container, to an event stream (NetLog). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Split up RequestTracker into ConnectJobTracker+RequestTracker+RequestTrackerBase, address comments Created 10 years, 9 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_network_transaction.cc ('k') | net/http/http_basic_stream.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/io_buffer.h"
10 #include "net/base/load_states.h" 10 #include "net/base/load_states.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 class FtpResponseInfo; 14 class FtpResponseInfo;
15 class FtpRequestInfo; 15 class FtpRequestInfo;
16 class LoadLog; 16 class BoundNetLog;
17 17
18 // Represents a single FTP transaction. 18 // Represents a single FTP transaction.
19 class FtpTransaction { 19 class FtpTransaction {
20 public: 20 public:
21 // Stops any pending IO and destroys the transaction object. 21 // Stops any pending IO and destroys the transaction object.
22 virtual ~FtpTransaction() {} 22 virtual ~FtpTransaction() {}
23 23
24 // Starts the FTP transaction (i.e., sends the FTP request). 24 // Starts the FTP transaction (i.e., sends the FTP request).
25 // 25 //
26 // Returns OK if the transaction could be started synchronously, which means 26 // Returns OK if the transaction could be started synchronously, which means
27 // that the request was served from the cache (only supported for directory 27 // that the request was served from the cache (only supported for directory
28 // listings). ERR_IO_PENDING is returned to indicate that the 28 // listings). ERR_IO_PENDING is returned to indicate that the
29 // CompletionCallback will be notified once response info is available or if 29 // CompletionCallback will be notified once response info is available or if
30 // an IO error occurs. Any other return value indicates that the transaction 30 // an IO error occurs. Any other return value indicates that the transaction
31 // could not be started. 31 // could not be started.
32 // 32 //
33 // Regardless of the return value, the caller is expected to keep the 33 // Regardless of the return value, the caller is expected to keep the
34 // request_info object alive until Destroy is called on the transaction. 34 // request_info object alive until Destroy is called on the transaction.
35 // 35 //
36 // NOTE: The transaction is not responsible for deleting the callback object. 36 // NOTE: The transaction is not responsible for deleting the callback object.
37 // 37 //
38 // Profiling information for the request is saved to |load_log| if non-NULL. 38 // Profiling information for the request is saved to |net_log| if non-NULL.
39 virtual int Start(const FtpRequestInfo* request_info, 39 virtual int Start(const FtpRequestInfo* request_info,
40 CompletionCallback* callback, 40 CompletionCallback* callback,
41 LoadLog* load_log) = 0; 41 const BoundNetLog& net_log) = 0;
42 42
43 // Restarts the FTP transaction with authentication credentials. 43 // Restarts the FTP transaction with authentication credentials.
44 virtual int RestartWithAuth(const std::wstring& username, 44 virtual int RestartWithAuth(const std::wstring& username,
45 const std::wstring& password, 45 const std::wstring& password,
46 CompletionCallback* callback) = 0; 46 CompletionCallback* callback) = 0;
47 47
48 // Once response info is available for the transaction, response data may be 48 // Once response info is available for the transaction, response data may be
49 // read by calling this method. 49 // read by calling this method.
50 // 50 //
51 // Response data is copied into the given buffer and the number of bytes 51 // Response data is copied into the given buffer and the number of bytes
(...skipping 18 matching lines...) Expand all
70 virtual LoadState GetLoadState() const = 0; 70 virtual LoadState GetLoadState() const = 0;
71 71
72 // Returns the upload progress in bytes. If there is no upload data, 72 // Returns the upload progress in bytes. If there is no upload data,
73 // zero will be returned. 73 // zero will be returned.
74 virtual uint64 GetUploadProgress() const = 0; 74 virtual uint64 GetUploadProgress() const = 0;
75 }; 75 };
76 76
77 } // namespace net 77 } // namespace net
78 78
79 #endif // NET_FTP_FTP_TRANSACTION_H_ 79 #endif // NET_FTP_FTP_TRANSACTION_H_
OLDNEW
« no previous file with comments | « net/ftp/ftp_network_transaction.cc ('k') | net/http/http_basic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698