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

Side by Side Diff: net/http/http_stream.h

Issue 10834178: net: Return size of upload as well as position from HttpTransaction::GetUploadProgress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // HttpStream is an interface for reading and writing data to an HttpStream that 5 // HttpStream is an interface for reading and writing data to an HttpStream that
6 // keeps the client agnostic of the actual underlying transport layer. This 6 // keeps the client agnostic of the actual underlying transport layer. This
7 // provides an abstraction for both a basic http stream as well as http 7 // provides an abstraction for both a basic http stream as well as http
8 // pipelining implementations. The HttpStream subtype is expected to manage the 8 // pipelining implementations. The HttpStream subtype is expected to manage the
9 // underlying transport appropriately. For example, a non-pipelined HttpStream 9 // underlying transport appropriately. For example, a non-pipelined HttpStream
10 // would return the transport socket to the pool for reuse. SPDY streams on the 10 // would return the transport socket to the pool for reuse. SPDY streams on the
11 // other hand leave the transport socket management to the SpdySession. 11 // other hand leave the transport socket management to the SpdySession.
12 12
13 #ifndef NET_HTTP_HTTP_STREAM_H_ 13 #ifndef NET_HTTP_HTTP_STREAM_H_
14 #define NET_HTTP_HTTP_STREAM_H_ 14 #define NET_HTTP_HTTP_STREAM_H_
15 15
16 #include <string> 16 #include <string>
17 17
18 #include "base/basictypes.h" 18 #include "base/basictypes.h"
19 #include "base/memory/scoped_ptr.h" 19 #include "base/memory/scoped_ptr.h"
20 #include "net/base/completion_callback.h" 20 #include "net/base/completion_callback.h"
21 #include "net/base/net_export.h" 21 #include "net/base/net_export.h"
22 #include "net/base/upload_progress.h"
22 23
23 namespace net { 24 namespace net {
24 25
25 class BoundNetLog; 26 class BoundNetLog;
26 class HttpNetworkSession; 27 class HttpNetworkSession;
27 class HttpRequestHeaders; 28 class HttpRequestHeaders;
28 struct HttpRequestInfo; 29 struct HttpRequestInfo;
29 class HttpResponseInfo; 30 class HttpResponseInfo;
30 class IOBuffer; 31 class IOBuffer;
31 class SSLCertRequestInfo; 32 class SSLCertRequestInfo;
(...skipping 14 matching lines...) Expand all
46 // Writes the headers and uploads body data to the underlying socket. 47 // Writes the headers and uploads body data to the underlying socket.
47 // ERR_IO_PENDING is returned if the operation could not be completed 48 // ERR_IO_PENDING is returned if the operation could not be completed
48 // synchronously, in which case the result will be passed to the callback 49 // synchronously, in which case the result will be passed to the callback
49 // when available. Returns OK on success. 50 // when available. Returns OK on success.
50 virtual int SendRequest(const HttpRequestHeaders& request_headers, 51 virtual int SendRequest(const HttpRequestHeaders& request_headers,
51 scoped_ptr<UploadDataStream> request_body, 52 scoped_ptr<UploadDataStream> request_body,
52 HttpResponseInfo* response, 53 HttpResponseInfo* response,
53 const CompletionCallback& callback) = 0; 54 const CompletionCallback& callback) = 0;
54 55
55 // Queries the UploadDataStream for its progress (bytes sent). 56 // Queries the UploadDataStream for its progress (bytes sent).
56 virtual uint64 GetUploadProgress() const = 0; 57 virtual UploadProgress GetUploadProgress() const = 0;
57 58
58 // Reads from the underlying socket until the response headers have been 59 // Reads from the underlying socket until the response headers have been
59 // completely received. ERR_IO_PENDING is returned if the operation could 60 // completely received. ERR_IO_PENDING is returned if the operation could
60 // not be completed synchronously, in which case the result will be passed 61 // not be completed synchronously, in which case the result will be passed
61 // to the callback when available. Returns OK on success. The response 62 // to the callback when available. Returns OK on success. The response
62 // headers are available in the HttpResponseInfo returned by GetResponseInfo 63 // headers are available in the HttpResponseInfo returned by GetResponseInfo
63 virtual int ReadResponseHeaders(const CompletionCallback& callback) = 0; 64 virtual int ReadResponseHeaders(const CompletionCallback& callback) = 0;
64 65
65 // Provides access to HttpResponseInfo (owned by HttpStream). 66 // Provides access to HttpResponseInfo (owned by HttpStream).
66 virtual const HttpResponseInfo* GetResponseInfo() const = 0; 67 virtual const HttpResponseInfo* GetResponseInfo() const = 0;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // draining is complete. 146 // draining is complete.
146 virtual void Drain(HttpNetworkSession* session) = 0; 147 virtual void Drain(HttpNetworkSession* session) = 0;
147 148
148 private: 149 private:
149 DISALLOW_COPY_AND_ASSIGN(HttpStream); 150 DISALLOW_COPY_AND_ASSIGN(HttpStream);
150 }; 151 };
151 152
152 } // namespace net 153 } // namespace net
153 154
154 #endif // NET_HTTP_HTTP_STREAM_H_ 155 #endif // NET_HTTP_HTTP_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698