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