| 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 #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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 DISALLOW_COPY_AND_ASSIGN(Delegate); | 166 DISALLOW_COPY_AND_ASSIGN(Delegate); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 // SpdyStream constructor | 169 // SpdyStream constructor |
| 170 SpdyStream(SpdyStreamType type, | 170 SpdyStream(SpdyStreamType type, |
| 171 const base::WeakPtr<SpdySession>& session, | 171 const base::WeakPtr<SpdySession>& session, |
| 172 const GURL& url, | 172 const GURL& url, |
| 173 RequestPriority priority, | 173 RequestPriority priority, |
| 174 int32_t initial_send_window_size, | 174 int32_t initial_send_window_size, |
| 175 int32_t max_recv_window_size, | 175 int32_t max_recv_window_size, |
| 176 const BoundNetLog& net_log); | 176 const NetLogWithSource& net_log); |
| 177 | 177 |
| 178 ~SpdyStream(); | 178 ~SpdyStream(); |
| 179 | 179 |
| 180 // Set the delegate, which must not be NULL. Must not be called more | 180 // Set the delegate, which must not be NULL. Must not be called more |
| 181 // than once. For push streams, calling this may cause buffered data | 181 // than once. For push streams, calling this may cause buffered data |
| 182 // to be sent to the delegate (from a posted task). | 182 // to be sent to the delegate (from a posted task). |
| 183 void SetDelegate(Delegate* delegate); | 183 void SetDelegate(Delegate* delegate); |
| 184 | 184 |
| 185 // Detach the delegate from the stream, which must not yet be | 185 // Detach the delegate from the stream, which must not yet be |
| 186 // closed, and cancel it. | 186 // closed, and cancel it. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // this must not be called. | 280 // this must not be called. |
| 281 void DecreaseRecvWindowSize(int32_t delta_window_size); | 281 void DecreaseRecvWindowSize(int32_t delta_window_size); |
| 282 | 282 |
| 283 int GetPeerAddress(IPEndPoint* address) const; | 283 int GetPeerAddress(IPEndPoint* address) const; |
| 284 int GetLocalAddress(IPEndPoint* address) const; | 284 int GetLocalAddress(IPEndPoint* address) const; |
| 285 | 285 |
| 286 // Returns true if the underlying transport socket ever had any reads or | 286 // Returns true if the underlying transport socket ever had any reads or |
| 287 // writes. | 287 // writes. |
| 288 bool WasEverUsed() const; | 288 bool WasEverUsed() const; |
| 289 | 289 |
| 290 const BoundNetLog& net_log() const { return net_log_; } | 290 const NetLogWithSource& net_log() const { return net_log_; } |
| 291 | 291 |
| 292 base::Time GetRequestTime() const; | 292 base::Time GetRequestTime() const; |
| 293 void SetRequestTime(base::Time t); | 293 void SetRequestTime(base::Time t); |
| 294 | 294 |
| 295 // Called at most once by the SpdySession when the initial response headers | 295 // Called at most once by the SpdySession when the initial response headers |
| 296 // have been received for this stream. Returns a status code; if it is an | 296 // have been received for this stream. Returns a status code; if it is an |
| 297 // error, the stream was closed by this function. | 297 // error, the stream was closed by this function. |
| 298 int OnInitialResponseHeadersReceived(const SpdyHeaderBlock& response_headers, | 298 int OnInitialResponseHeadersReceived(const SpdyHeaderBlock& response_headers, |
| 299 base::Time response_time, | 299 base::Time response_time, |
| 300 base::TimeTicks recv_first_byte_time); | 300 base::TimeTicks recv_first_byte_time); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 SpdyHeaderBlock response_headers_; | 540 SpdyHeaderBlock response_headers_; |
| 541 SpdyResponseHeadersStatus response_headers_status_; | 541 SpdyResponseHeadersStatus response_headers_status_; |
| 542 base::Time response_time_; | 542 base::Time response_time_; |
| 543 | 543 |
| 544 State io_state_; | 544 State io_state_; |
| 545 | 545 |
| 546 // Since we buffer the response, we also buffer the response status. | 546 // Since we buffer the response, we also buffer the response status. |
| 547 // Not valid until the stream is closed. | 547 // Not valid until the stream is closed. |
| 548 int response_status_; | 548 int response_status_; |
| 549 | 549 |
| 550 BoundNetLog net_log_; | 550 NetLogWithSource net_log_; |
| 551 | 551 |
| 552 base::TimeTicks send_time_; | 552 base::TimeTicks send_time_; |
| 553 base::TimeTicks recv_first_byte_time_; | 553 base::TimeTicks recv_first_byte_time_; |
| 554 base::TimeTicks recv_last_byte_time_; | 554 base::TimeTicks recv_last_byte_time_; |
| 555 | 555 |
| 556 // Number of bytes that have been received on this stream, including frame | 556 // Number of bytes that have been received on this stream, including frame |
| 557 // overhead and headers. | 557 // overhead and headers. |
| 558 int64_t raw_received_bytes_; | 558 int64_t raw_received_bytes_; |
| 559 // Number of bytes that have been sent on this stream, including frame | 559 // Number of bytes that have been sent on this stream, including frame |
| 560 // overhead and headers. | 560 // overhead and headers. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 571 bool write_handler_guard_; | 571 bool write_handler_guard_; |
| 572 | 572 |
| 573 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; | 573 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; |
| 574 | 574 |
| 575 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 575 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
| 576 }; | 576 }; |
| 577 | 577 |
| 578 } // namespace net | 578 } // namespace net |
| 579 | 579 |
| 580 #endif // NET_SPDY_SPDY_STREAM_H_ | 580 #endif // NET_SPDY_SPDY_STREAM_H_ |
| OLD | NEW |