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 // A QuicSession, which demuxes a single connection to individual streams. | 5 // A QuicSession, which demuxes a single connection to individual streams. |
6 | 6 |
7 #ifndef NET_QUIC_QUIC_SESSION_H_ | 7 #ifndef NET_QUIC_QUIC_SESSION_H_ |
8 #define NET_QUIC_QUIC_SESSION_H_ | 8 #define NET_QUIC_QUIC_SESSION_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // QuicConnectionVisitorInterface methods: | 62 // QuicConnectionVisitorInterface methods: |
63 void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override; | 63 void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override; |
64 void OnRstStream(const QuicRstStreamFrame& frame) override; | 64 void OnRstStream(const QuicRstStreamFrame& frame) override; |
65 void OnGoAway(const QuicGoAwayFrame& frame) override; | 65 void OnGoAway(const QuicGoAwayFrame& frame) override; |
66 void OnWindowUpdateFrames( | 66 void OnWindowUpdateFrames( |
67 const std::vector<QuicWindowUpdateFrame>& frames) override; | 67 const std::vector<QuicWindowUpdateFrame>& frames) override; |
68 void OnBlockedFrames(const std::vector<QuicBlockedFrame>& frames) override; | 68 void OnBlockedFrames(const std::vector<QuicBlockedFrame>& frames) override; |
69 void OnConnectionClosed(QuicErrorCode error, bool from_peer) override; | 69 void OnConnectionClosed(QuicErrorCode error, bool from_peer) override; |
70 void OnWriteBlocked() override {} | 70 void OnWriteBlocked() override {} |
71 void OnSuccessfulVersionNegotiation(const QuicVersion& version) override {} | 71 void OnSuccessfulVersionNegotiation(const QuicVersion& version) override; |
72 void OnCanWrite() override; | 72 void OnCanWrite() override; |
73 void OnCongestionWindowChange(QuicTime now) override {} | 73 void OnCongestionWindowChange(QuicTime now) override {} |
74 bool WillingAndAbleToWrite() const override; | 74 bool WillingAndAbleToWrite() const override; |
75 bool HasPendingHandshake() const override; | 75 bool HasPendingHandshake() const override; |
76 bool HasOpenDataStreams() const override; | 76 bool HasOpenDataStreams() const override; |
77 | 77 |
78 // Called by the headers stream when headers have been received for a stream. | 78 // Called by the headers stream when headers have been received for a stream. |
79 virtual void OnStreamHeaders(QuicStreamId stream_id, | 79 virtual void OnStreamHeaders(QuicStreamId stream_id, |
80 base::StringPiece headers_data); | 80 base::StringPiece headers_data); |
81 // Called by the headers stream when headers with a priority have been | 81 // Called by the headers stream when headers with a priority have been |
(...skipping 27 matching lines...) Expand all Loading... |
109 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); | 109 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); |
110 | 110 |
111 // Writes |headers| for the stream |id| to the dedicated headers stream. | 111 // Writes |headers| for the stream |id| to the dedicated headers stream. |
112 // If |fin| is true, then no more data will be sent for the stream |id|. | 112 // If |fin| is true, then no more data will be sent for the stream |id|. |
113 // If provided, |ack_notifier_delegate| will be registered to be notified when | 113 // If provided, |ack_notifier_delegate| will be registered to be notified when |
114 // we have seen ACKs for all packets resulting from this call. | 114 // we have seen ACKs for all packets resulting from this call. |
115 size_t WriteHeaders( | 115 size_t WriteHeaders( |
116 QuicStreamId id, | 116 QuicStreamId id, |
117 const SpdyHeaderBlock& headers, | 117 const SpdyHeaderBlock& headers, |
118 bool fin, | 118 bool fin, |
| 119 QuicPriority priority, |
119 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); | 120 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); |
120 | 121 |
121 // Called by streams when they want to close the stream in both directions. | 122 // Called by streams when they want to close the stream in both directions. |
122 virtual void SendRstStream(QuicStreamId id, | 123 virtual void SendRstStream(QuicStreamId id, |
123 QuicRstStreamErrorCode error, | 124 QuicRstStreamErrorCode error, |
124 QuicStreamOffset bytes_written); | 125 QuicStreamOffset bytes_written); |
125 | 126 |
126 // Called when the session wants to go away and not accept any new streams. | 127 // Called when the session wants to go away and not accept any new streams. |
127 void SendGoAway(QuicErrorCode error_code, const std::string& reason); | 128 void SendGoAway(QuicErrorCode error_code, const std::string& reason); |
128 | 129 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 333 |
333 // Indicate if there is pending data for the crypto stream. | 334 // Indicate if there is pending data for the crypto stream. |
334 bool has_pending_handshake_; | 335 bool has_pending_handshake_; |
335 | 336 |
336 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 337 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
337 }; | 338 }; |
338 | 339 |
339 } // namespace net | 340 } // namespace net |
340 | 341 |
341 #endif // NET_QUIC_QUIC_SESSION_H_ | 342 #endif // NET_QUIC_QUIC_SESSION_H_ |
OLD | NEW |