| 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 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 virtual void SetConnectionReused() = 0; | 111 virtual void SetConnectionReused() = 0; |
| 112 | 112 |
| 113 // Checks whether the underlying connection can be reused. The stream's | 113 // Checks whether the underlying connection can be reused. The stream's |
| 114 // connection can be reused if the response headers allow for it, the socket | 114 // connection can be reused if the response headers allow for it, the socket |
| 115 // is still connected, and the stream exclusively owns the underlying | 115 // is still connected, and the stream exclusively owns the underlying |
| 116 // connection. SPDY and QUIC streams don't own their own connections, so | 116 // connection. SPDY and QUIC streams don't own their own connections, so |
| 117 // always return false. | 117 // always return false. |
| 118 virtual bool CanReuseConnection() const = 0; | 118 virtual bool CanReuseConnection() const = 0; |
| 119 | 119 |
| 120 // Get the total number of bytes received from network for this stream. | 120 // Get the total number of bytes received from network for this stream. |
| 121 virtual int64 GetTotalReceivedBytes() const = 0; | 121 virtual int64_t GetTotalReceivedBytes() const = 0; |
| 122 | 122 |
| 123 // Get the total number of bytes sent over the network for this stream. | 123 // Get the total number of bytes sent over the network for this stream. |
| 124 virtual int64_t GetTotalSentBytes() const = 0; | 124 virtual int64_t GetTotalSentBytes() const = 0; |
| 125 | 125 |
| 126 // Populates the connection establishment part of |load_timing_info|, and | 126 // Populates the connection establishment part of |load_timing_info|, and |
| 127 // socket ID. |load_timing_info| must have all null times when called. | 127 // socket ID. |load_timing_info| must have all null times when called. |
| 128 // Returns false and does nothing if there is no underlying connection, either | 128 // Returns false and does nothing if there is no underlying connection, either |
| 129 // because one has yet to be assigned to the stream, or because the underlying | 129 // because one has yet to be assigned to the stream, or because the underlying |
| 130 // socket has been closed. | 130 // socket has been closed. |
| 131 // | 131 // |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // subclass does not support renewing the stream, NULL is returned. | 163 // subclass does not support renewing the stream, NULL is returned. |
| 164 virtual HttpStream* RenewStreamForAuth() = 0; | 164 virtual HttpStream* RenewStreamForAuth() = 0; |
| 165 | 165 |
| 166 private: | 166 private: |
| 167 DISALLOW_COPY_AND_ASSIGN(HttpStream); | 167 DISALLOW_COPY_AND_ASSIGN(HttpStream); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 } // namespace net | 170 } // namespace net |
| 171 | 171 |
| 172 #endif // NET_HTTP_HTTP_STREAM_H_ | 172 #endif // NET_HTTP_HTTP_STREAM_H_ |
| OLD | NEW |