Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: net/quic/chromium/bidirectional_stream_quic_impl.h

Issue 2900533002: Add an async ReadTrailers method to QuicChromiumClientStream::Handle (Closed)
Patch Set: Fix comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers,
62 size_t frame_len) override;
63 void OnClose() override; 61 void OnClose() override;
64 void OnError(int error) override; 62 void OnError(int error) override;
65 63
66 void OnStreamReady(int rv); 64 void OnStreamReady(int rv);
67 void OnSendDataComplete(int rv); 65 void OnSendDataComplete(int rv);
68 void OnReadInitialHeadersComplete(int rv); 66 void OnReadInitialHeadersComplete(int rv);
67 void ReadTrailingHeaders();
68 void OnReadTrailingHeadersComplete(int rv);
69 void OnReadDataComplete(int rv); 69 void OnReadDataComplete(int rv);
70 70
71 // Notifies the delegate of an error. 71 // Notifies the delegate of an error.
72 void NotifyError(int error); 72 void NotifyError(int error);
73 // Notifies the delegate that the stream is ready. 73 // Notifies the delegate that the stream is ready.
74 void NotifyStreamReady(); 74 void NotifyStreamReady();
75 // Resets the stream and ensures that |delegate_| won't be called back. 75 // Resets the stream and ensures that |delegate_| won't be called back.
76 void ResetStream(); 76 void ResetStream();
77 77
78 const std::unique_ptr<QuicChromiumClientSession::Handle> session_; 78 const std::unique_ptr<QuicChromiumClientSession::Handle> session_;
79 std::unique_ptr<QuicChromiumClientStream::Handle> stream_; 79 std::unique_ptr<QuicChromiumClientStream::Handle> stream_;
80 80
81 const BidirectionalStreamRequestInfo* request_info_; 81 const BidirectionalStreamRequestInfo* request_info_;
82 BidirectionalStreamImpl::Delegate* delegate_; 82 BidirectionalStreamImpl::Delegate* delegate_;
83 // Saves the response status if the stream is explicitly closed via OnError 83 // Saves the response status if the stream is explicitly closed via OnError
84 // or OnClose with an error. Once all buffered data has been returned, this 84 // or OnClose with an error. Once all buffered data has been returned, this
85 // will be used as the final response. 85 // will be used as the final response.
86 int response_status_; 86 int response_status_;
87 87
88 // The protocol that is negotiated. 88 // The protocol that is negotiated.
89 NextProto negotiated_protocol_; 89 NextProto negotiated_protocol_;
90 // Connect timing information for this stream. Populated when headers are 90 // Connect timing information for this stream. Populated when headers are
91 // received. 91 // received.
92 LoadTimingInfo::ConnectTiming connect_timing_; 92 LoadTimingInfo::ConnectTiming connect_timing_;
93 93
94 SpdyHeaderBlock initial_headers_; 94 SpdyHeaderBlock initial_headers_;
95 SpdyHeaderBlock trailing_headers_;
95 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
(...skipping 16 matching lines...) Expand all
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_
OLDNEW
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698