| OLD | NEW |
| 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 provides an abstraction for a basic http streams, SPDY, and QUIC. | 5 // HttpStream provides an abstraction for a basic http streams, SPDY, and QUIC. |
| 6 // The HttpStream subtype is expected to manage the underlying transport | 6 // The HttpStream subtype is expected to manage the underlying transport |
| 7 // appropriately. For example, a basic http stream will return the transport | 7 // appropriately. For example, a basic http stream will return the transport |
| 8 // socket to the pool for reuse. SPDY streams on the other hand leave the | 8 // socket to the pool for reuse. SPDY streams on the other hand leave the |
| 9 // transport socket management to the SpdySession. | 9 // transport socket management to the SpdySession. |
| 10 | 10 |
| 11 #ifndef NET_HTTP_HTTP_STREAM_H_ | 11 #ifndef NET_HTTP_HTTP_STREAM_H_ |
| 12 #define NET_HTTP_HTTP_STREAM_H_ | 12 #define NET_HTTP_HTTP_STREAM_H_ |
| 13 | 13 |
| 14 #include <stdint.h> |
| 15 |
| 14 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 15 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 16 #include "net/base/completion_callback.h" | 18 #include "net/base/completion_callback.h" |
| 17 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
| 18 #include "net/base/request_priority.h" | 20 #include "net/base/request_priority.h" |
| 19 #include "net/base/upload_progress.h" | 21 #include "net/base/upload_progress.h" |
| 20 | 22 |
| 21 namespace net { | 23 namespace net { |
| 22 | 24 |
| 23 class BoundNetLog; | 25 class BoundNetLog; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 virtual bool IsConnectionReused() const = 0; | 116 virtual bool IsConnectionReused() const = 0; |
| 115 virtual void SetConnectionReused() = 0; | 117 virtual void SetConnectionReused() = 0; |
| 116 | 118 |
| 117 // Checks whether the current state of the underlying connection | 119 // Checks whether the current state of the underlying connection |
| 118 // allows it to be reused. | 120 // allows it to be reused. |
| 119 virtual bool IsConnectionReusable() const = 0; | 121 virtual bool IsConnectionReusable() const = 0; |
| 120 | 122 |
| 121 // Get the total number of bytes received from network for this stream. | 123 // Get the total number of bytes received from network for this stream. |
| 122 virtual int64 GetTotalReceivedBytes() const = 0; | 124 virtual int64 GetTotalReceivedBytes() const = 0; |
| 123 | 125 |
| 126 // Get the total number of bytes sent over the network for this stream. |
| 127 virtual int64_t GetTotalSentBytes() const = 0; |
| 128 |
| 124 // Populates the connection establishment part of |load_timing_info|, and | 129 // Populates the connection establishment part of |load_timing_info|, and |
| 125 // socket ID. |load_timing_info| must have all null times when called. | 130 // socket ID. |load_timing_info| must have all null times when called. |
| 126 // Returns false and does nothing if there is no underlying connection, either | 131 // Returns false and does nothing if there is no underlying connection, either |
| 127 // because one has yet to be assigned to the stream, or because the underlying | 132 // because one has yet to be assigned to the stream, or because the underlying |
| 128 // socket has been closed. | 133 // socket has been closed. |
| 129 // | 134 // |
| 130 // In practice, this means that this function will always succeed any time | 135 // In practice, this means that this function will always succeed any time |
| 131 // between when the full headers have been received and the stream has been | 136 // between when the full headers have been received and the stream has been |
| 132 // closed. | 137 // closed. |
| 133 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; | 138 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // subclass does not support renewing the stream, NULL is returned. | 170 // subclass does not support renewing the stream, NULL is returned. |
| 166 virtual HttpStream* RenewStreamForAuth() = 0; | 171 virtual HttpStream* RenewStreamForAuth() = 0; |
| 167 | 172 |
| 168 private: | 173 private: |
| 169 DISALLOW_COPY_AND_ASSIGN(HttpStream); | 174 DISALLOW_COPY_AND_ASSIGN(HttpStream); |
| 170 }; | 175 }; |
| 171 | 176 |
| 172 } // namespace net | 177 } // namespace net |
| 173 | 178 |
| 174 #endif // NET_HTTP_HTTP_STREAM_H_ | 179 #endif // NET_HTTP_HTTP_STREAM_H_ |
| OLD | NEW |