| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ | 5 #ifndef NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ |
| 6 #define NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ | 6 #define NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, | 51 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, |
| 52 const std::vector<int>& lengths, | 52 const std::vector<int>& lengths, |
| 53 bool end_stream) override; | 53 bool end_stream) override; |
| 54 NextProto GetProtocol() const override; | 54 NextProto GetProtocol() const override; |
| 55 int64_t GetTotalReceivedBytes() const override; | 55 int64_t GetTotalReceivedBytes() const override; |
| 56 int64_t GetTotalSentBytes() const override; | 56 int64_t GetTotalSentBytes() const override; |
| 57 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; | 57 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // QuicChromiumClientStream::Delegate implementation: | 60 // QuicChromiumClientStream::Delegate implementation: |
| 61 void OnInitialHeadersAvailable(const SpdyHeaderBlock& headers, | |
| 62 size_t frame_len) override; | |
| 63 void OnDataAvailable() override; | 61 void OnDataAvailable() override; |
| 64 void OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers, | 62 void OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers, |
| 65 size_t frame_len) override; | 63 size_t frame_len) override; |
| 66 void OnClose() override; | 64 void OnClose() override; |
| 67 void OnError(int error) override; | 65 void OnError(int error) override; |
| 68 | 66 |
| 69 void OnStreamReady(int rv); | 67 void OnStreamReady(int rv); |
| 70 void OnSendDataComplete(int rv); | 68 void OnSendDataComplete(int rv); |
| 69 void OnReadInitialHeadersComplete(int rv); |
| 71 void OnReadDataComplete(int rv); | 70 void OnReadDataComplete(int rv); |
| 72 | 71 |
| 73 // Notifies the delegate of an error. | 72 // Notifies the delegate of an error. |
| 74 void NotifyError(int error); | 73 void NotifyError(int error); |
| 75 // Notifies the delegate that the stream is ready. | 74 // Notifies the delegate that the stream is ready. |
| 76 void NotifyStreamReady(); | 75 void NotifyStreamReady(); |
| 77 // Resets the stream and ensures that |delegate_| won't be called back. | 76 // Resets the stream and ensures that |delegate_| won't be called back. |
| 78 void ResetStream(); | 77 void ResetStream(); |
| 79 | 78 |
| 80 const std::unique_ptr<QuicChromiumClientSession::Handle> session_; | 79 const std::unique_ptr<QuicChromiumClientSession::Handle> session_; |
| 81 std::unique_ptr<QuicChromiumClientStream::Handle> stream_; | 80 std::unique_ptr<QuicChromiumClientStream::Handle> stream_; |
| 82 | 81 |
| 83 const BidirectionalStreamRequestInfo* request_info_; | 82 const BidirectionalStreamRequestInfo* request_info_; |
| 84 BidirectionalStreamImpl::Delegate* delegate_; | 83 BidirectionalStreamImpl::Delegate* delegate_; |
| 85 // Saves the response status if the stream is explicitly closed via OnError | 84 // Saves the response status if the stream is explicitly closed via OnError |
| 86 // or OnClose with an error. Once all buffered data has been returned, this | 85 // or OnClose with an error. Once all buffered data has been returned, this |
| 87 // will be used as the final response. | 86 // will be used as the final response. |
| 88 int response_status_; | 87 int response_status_; |
| 89 | 88 |
| 90 // The protocol that is negotiated. | 89 // The protocol that is negotiated. |
| 91 NextProto negotiated_protocol_; | 90 NextProto negotiated_protocol_; |
| 92 // Connect timing information for this stream. Populated when headers are | 91 // Connect timing information for this stream. Populated when headers are |
| 93 // received. | 92 // received. |
| 94 LoadTimingInfo::ConnectTiming connect_timing_; | 93 LoadTimingInfo::ConnectTiming connect_timing_; |
| 95 | 94 |
| 95 SpdyHeaderBlock initial_headers_; |
| 96 |
| 96 // User provided read buffer for ReadData() response. | 97 // User provided read buffer for ReadData() response. |
| 97 scoped_refptr<IOBuffer> read_buffer_; | 98 scoped_refptr<IOBuffer> read_buffer_; |
| 98 int read_buffer_len_; | 99 int read_buffer_len_; |
| 99 | 100 |
| 100 // Number of bytes received by the headers stream on behalf of this stream. | 101 // Number of bytes received by the headers stream on behalf of this stream. |
| 101 int64_t headers_bytes_received_; | 102 int64_t headers_bytes_received_; |
| 102 // Number of bytes sent by the headers stream on behalf of this stream. | 103 // Number of bytes sent by the headers stream on behalf of this stream. |
| 103 int64_t headers_bytes_sent_; | 104 int64_t headers_bytes_sent_; |
| 104 // After |stream_| has been closed, this keeps track of the total number of | 105 // After |stream_| has been closed, this keeps track of the total number of |
| 105 // bytes received over the network for |stream_| while it was open. | 106 // bytes received over the network for |stream_| while it was open. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 121 bool send_request_headers_automatically_; | 122 bool send_request_headers_automatically_; |
| 122 | 123 |
| 123 base::WeakPtrFactory<BidirectionalStreamQuicImpl> weak_factory_; | 124 base::WeakPtrFactory<BidirectionalStreamQuicImpl> weak_factory_; |
| 124 | 125 |
| 125 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamQuicImpl); | 126 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamQuicImpl); |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 } // namespace net | 129 } // namespace net |
| 129 | 130 |
| 130 #endif // NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ | 131 #endif // NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ |
| OLD | NEW |