| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ | 5 #ifndef NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ |
| 6 #define NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ | 6 #define NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public SpdyStream::Delegate { | 32 public SpdyStream::Delegate { |
| 33 public: | 33 public: |
| 34 explicit BidirectionalStreamSpdyImpl( | 34 explicit BidirectionalStreamSpdyImpl( |
| 35 const base::WeakPtr<SpdySession>& spdy_session); | 35 const base::WeakPtr<SpdySession>& spdy_session); |
| 36 | 36 |
| 37 ~BidirectionalStreamSpdyImpl() override; | 37 ~BidirectionalStreamSpdyImpl() override; |
| 38 | 38 |
| 39 // BidirectionalStreamImpl implementation: | 39 // BidirectionalStreamImpl implementation: |
| 40 void Start(const BidirectionalStreamRequestInfo* request_info, | 40 void Start(const BidirectionalStreamRequestInfo* request_info, |
| 41 const BoundNetLog& net_log, | 41 const BoundNetLog& net_log, |
| 42 bool disable_auto_flush, |
| 42 BidirectionalStreamImpl::Delegate* delegate, | 43 BidirectionalStreamImpl::Delegate* delegate, |
| 43 scoped_ptr<base::Timer> timer) override; | 44 scoped_ptr<base::Timer> timer) override; |
| 44 int ReadData(IOBuffer* buf, int buf_len) override; | 45 int ReadData(IOBuffer* buf, int buf_len) override; |
| 45 void SendData(IOBuffer* data, int length, bool end_stream) override; | 46 void SendData(IOBuffer* data, int length, bool end_stream) override; |
| 47 void SendvData(const std::vector<IOBuffer*>& buffers, |
| 48 const std::vector<int>& lengths, |
| 49 bool end_stream) override; |
| 46 void Cancel() override; | 50 void Cancel() override; |
| 47 NextProto GetProtocol() const override; | 51 NextProto GetProtocol() const override; |
| 48 int64_t GetTotalReceivedBytes() const override; | 52 int64_t GetTotalReceivedBytes() const override; |
| 49 int64_t GetTotalSentBytes() const override; | 53 int64_t GetTotalSentBytes() const override; |
| 50 | 54 |
| 51 // SpdyStream::Delegate implementation: | 55 // SpdyStream::Delegate implementation: |
| 52 void OnRequestHeadersSent() override; | 56 void OnRequestHeadersSent() override; |
| 53 SpdyResponseHeadersStatus OnResponseHeadersUpdated( | 57 SpdyResponseHeadersStatus OnResponseHeadersUpdated( |
| 54 const SpdyHeaderBlock& response_headers) override; | 58 const SpdyHeaderBlock& response_headers) override; |
| 55 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override; | 59 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 84 // Whether OnClose has been invoked. | 88 // Whether OnClose has been invoked. |
| 85 bool stream_closed_; | 89 bool stream_closed_; |
| 86 // Status reported in OnClose. | 90 // Status reported in OnClose. |
| 87 int closed_stream_status_; | 91 int closed_stream_status_; |
| 88 // After |stream_| has been closed, this keeps track of the total number of | 92 // After |stream_| has been closed, this keeps track of the total number of |
| 89 // bytes received over the network for |stream_| while it was open. | 93 // bytes received over the network for |stream_| while it was open. |
| 90 int64_t closed_stream_received_bytes_; | 94 int64_t closed_stream_received_bytes_; |
| 91 // After |stream_| has been closed, this keeps track of the total number of | 95 // After |stream_| has been closed, this keeps track of the total number of |
| 92 // bytes sent over the network for |stream_| while it was open. | 96 // bytes sent over the network for |stream_| while it was open. |
| 93 int64_t closed_stream_sent_bytes_; | 97 int64_t closed_stream_sent_bytes_; |
| 98 // Whether auto flush is disabled. |
| 99 bool disable_auto_flush_; |
| 100 // Only relevant when |disable_auto_flush_| is true; |
| 101 // This is the combined buffer of buffers passed in through SendvData. |
| 102 scoped_refptr<IOBuffer> pending_combined_buffer_; |
| 94 | 103 |
| 95 base::WeakPtrFactory<BidirectionalStreamSpdyImpl> weak_factory_; | 104 base::WeakPtrFactory<BidirectionalStreamSpdyImpl> weak_factory_; |
| 96 | 105 |
| 97 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamSpdyImpl); | 106 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamSpdyImpl); |
| 98 }; | 107 }; |
| 99 | 108 |
| 100 } // namespace net | 109 } // namespace net |
| 101 | 110 |
| 102 #endif // NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ | 111 #endif // NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ |
| OLD | NEW |