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
3 // found in the LICENSE file.
5 // HttpStream provides an abstraction for a basic http streams, http pipelining
6 // implementations, and SPDY. The HttpStream subtype is expected to manage the
7 // underlying transport appropriately. For example, a non-pipelined HttpStream
8 // would return the transport socket to the pool for reuse. SPDY streams on the
9 // other hand leave the transport socket management to the SpdySession.
11 #ifndef NET_HTTP_HTTP_STREAM_H_
12 #define NET_HTTP_HTTP_STREAM_H_
14 #include "base/basictypes.h"
15 #include "net/base/completion_callback.h"
16 #include "net/base/net_export.h"
17 #include "net/base/upload_progress.h"
18 #include "net/http/http_stream_base.h"
24 class NET_EXPORT_PRIVATE HttpStream
: public HttpStreamBase
{
27 virtual ~HttpStream() {}
29 // Queries the UploadDataStream for its progress (bytes sent).
30 virtual UploadProgress
GetUploadProgress() const = 0;
32 // Returns a new (not initialized) stream using the same underlying
33 // connection and invalidates the old stream - no further methods should be
34 // called on the old stream. The caller should ensure that the response body
35 // from the previous request is drained before calling this method. If the
36 // subclass does not support renewing the stream, NULL is returned.
37 virtual HttpStream
* RenewStreamForAuth() = 0;
40 DISALLOW_COPY_AND_ASSIGN(HttpStream
);
45 #endif // NET_HTTP_HTTP_STREAM_H_