| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // Checks whether the underlying connection can be reused. The stream's | 113 // Checks whether the underlying connection can be reused. The stream's |
| 112 // 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 |
| 113 // is still connected, and the stream exclusively owns the underlying | 115 // is still connected, and the stream exclusively owns the underlying |
| 114 // 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 |
| 115 // always return false. | 117 // always return false. |
| 116 virtual bool CanReuseConnection() const = 0; | 118 virtual bool CanReuseConnection() const = 0; |
| 117 | 119 |
| 118 // 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. |
| 119 virtual int64 GetTotalReceivedBytes() const = 0; | 121 virtual int64 GetTotalReceivedBytes() const = 0; |
| 120 | 122 |
| 123 // Get the total number of bytes sent over the network for this stream. |
| 124 virtual int64_t GetTotalSentBytes() const = 0; |
| 125 |
| 121 // Populates the connection establishment part of |load_timing_info|, and | 126 // Populates the connection establishment part of |load_timing_info|, and |
| 122 // 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. |
| 123 // 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 |
| 124 // 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 |
| 125 // socket has been closed. | 130 // socket has been closed. |
| 126 // | 131 // |
| 127 // In practice, this means that this function will always succeed any time | 132 // In practice, this means that this function will always succeed any time |
| 128 // between when the full headers have been received and the stream has been | 133 // between when the full headers have been received and the stream has been |
| 129 // closed. | 134 // closed. |
| 130 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; | 135 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 158 // subclass does not support renewing the stream, NULL is returned. | 163 // subclass does not support renewing the stream, NULL is returned. |
| 159 virtual HttpStream* RenewStreamForAuth() = 0; | 164 virtual HttpStream* RenewStreamForAuth() = 0; |
| 160 | 165 |
| 161 private: | 166 private: |
| 162 DISALLOW_COPY_AND_ASSIGN(HttpStream); | 167 DISALLOW_COPY_AND_ASSIGN(HttpStream); |
| 163 }; | 168 }; |
| 164 | 169 |
| 165 } // namespace net | 170 } // namespace net |
| 166 | 171 |
| 167 #endif // NET_HTTP_HTTP_STREAM_H_ | 172 #endif // NET_HTTP_HTTP_STREAM_H_ |
| OLD | NEW |