| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef NET_SPDY_SPDY_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_STREAM_H_ |
| 6 #define NET_SPDY_SPDY_STREAM_H_ | 6 #define NET_SPDY_SPDY_STREAM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/singleton.h" | 14 #include "base/singleton.h" |
| 15 #include "net/base/bandwidth_metrics.h" | 15 #include "net/base/bandwidth_metrics.h" |
| 16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
| 17 #include "net/base/io_buffer.h" | 17 #include "net/base/io_buffer.h" |
| 18 #include "net/base/load_log.h" | 18 #include "net/base/net_log.h" |
| 19 #include "net/spdy/spdy_framer.h" | 19 #include "net/spdy/spdy_framer.h" |
| 20 #include "net/spdy/spdy_protocol.h" | 20 #include "net/spdy/spdy_protocol.h" |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 | 23 |
| 24 class HttpRequestInfo; | 24 class HttpRequestInfo; |
| 25 class HttpResponseInfo; | 25 class HttpResponseInfo; |
| 26 class SpdySession; | 26 class SpdySession; |
| 27 class UploadData; | 27 class UploadData; |
| 28 class UploadDataStream; | 28 class UploadDataStream; |
| 29 | 29 |
| 30 // The SpdyStream is used by the SpdySession to represent each stream known | 30 // The SpdyStream is used by the SpdySession to represent each stream known |
| 31 // on the SpdySession. | 31 // on the SpdySession. |
| 32 // Streams can be created either by the client or by the server. When they | 32 // Streams can be created either by the client or by the server. When they |
| 33 // are initiated by the client, both the SpdySession and client object (such as | 33 // are initiated by the client, both the SpdySession and client object (such as |
| 34 // a SpdyNetworkTransaction) will maintain a reference to the stream. When | 34 // a SpdyNetworkTransaction) will maintain a reference to the stream. When |
| 35 // initiated by the server, only the SpdySession will maintain any reference, | 35 // initiated by the server, only the SpdySession will maintain any reference, |
| 36 // until such a time as a client object requests a stream for the path. | 36 // until such a time as a client object requests a stream for the path. |
| 37 class SpdyStream : public base::RefCounted<SpdyStream> { | 37 class SpdyStream : public base::RefCounted<SpdyStream> { |
| 38 public: | 38 public: |
| 39 // SpdyStream constructor | 39 // SpdyStream constructor |
| 40 SpdyStream(SpdySession* session, spdy::SpdyStreamId stream_id, bool pushed, | 40 SpdyStream(SpdySession* session, spdy::SpdyStreamId stream_id, bool pushed, |
| 41 LoadLog* log); | 41 const BoundNetLog& log); |
| 42 | 42 |
| 43 // Ideally I'd use two abstract classes as interfaces for these two sections, | 43 // Ideally I'd use two abstract classes as interfaces for these two sections, |
| 44 // but since we're ref counted, I can't make both abstract classes inherit | 44 // but since we're ref counted, I can't make both abstract classes inherit |
| 45 // from RefCounted or we'll have two separate ref counts for the same object. | 45 // from RefCounted or we'll have two separate ref counts for the same object. |
| 46 // TODO(willchan): Consider using linked_ptr here orcreating proxy wrappers | 46 // TODO(willchan): Consider using linked_ptr here orcreating proxy wrappers |
| 47 // for SpdyStream to provide the appropriate interface. | 47 // for SpdyStream to provide the appropriate interface. |
| 48 | 48 |
| 49 // =================================================== | 49 // =================================================== |
| 50 // Interface for [Http|Spdy]NetworkTransaction to use. | 50 // Interface for [Http|Spdy]NetworkTransaction to use. |
| 51 | 51 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 int response_status_; | 191 int response_status_; |
| 192 | 192 |
| 193 CompletionCallback* user_callback_; | 193 CompletionCallback* user_callback_; |
| 194 | 194 |
| 195 // User provided buffer for the ReadResponseBody() response. | 195 // User provided buffer for the ReadResponseBody() response. |
| 196 scoped_refptr<IOBuffer> user_buffer_; | 196 scoped_refptr<IOBuffer> user_buffer_; |
| 197 int user_buffer_len_; | 197 int user_buffer_len_; |
| 198 | 198 |
| 199 bool cancelled_; | 199 bool cancelled_; |
| 200 | 200 |
| 201 scoped_refptr<LoadLog> load_log_; | 201 BoundNetLog net_log_; |
| 202 | 202 |
| 203 base::TimeTicks send_time_; | 203 base::TimeTicks send_time_; |
| 204 base::TimeTicks recv_first_byte_time_; | 204 base::TimeTicks recv_first_byte_time_; |
| 205 base::TimeTicks recv_last_byte_time_; | 205 base::TimeTicks recv_last_byte_time_; |
| 206 int send_bytes_; | 206 int send_bytes_; |
| 207 int recv_bytes_; | 207 int recv_bytes_; |
| 208 bool histograms_recorded_; | 208 bool histograms_recorded_; |
| 209 | 209 |
| 210 // Is there a scheduled read callback pending. | 210 // Is there a scheduled read callback pending. |
| 211 bool buffered_read_callback_pending_; | 211 bool buffered_read_callback_pending_; |
| 212 // Has more data been received from the network during the wait for the | 212 // Has more data been received from the network during the wait for the |
| 213 // scheduled read callback. | 213 // scheduled read callback. |
| 214 bool more_read_data_pending_; | 214 bool more_read_data_pending_; |
| 215 | 215 |
| 216 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 216 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 } // namespace net | 219 } // namespace net |
| 220 | 220 |
| 221 #endif // NET_SPDY_SPDY_STREAM_H_ | 221 #endif // NET_SPDY_SPDY_STREAM_H_ |
| OLD | NEW |