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 #include "net/quic/quic_session.h" | 5 #include "net/quic/quic_session.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 QuicDataStream* GetIncomingDataStream(QuicStreamId stream_id) { | 144 QuicDataStream* GetIncomingDataStream(QuicStreamId stream_id) { |
145 return QuicSession::GetIncomingDataStream(stream_id); | 145 return QuicSession::GetIncomingDataStream(stream_id); |
146 } | 146 } |
147 | 147 |
148 virtual QuicConsumedData WritevData( | 148 virtual QuicConsumedData WritevData( |
149 QuicStreamId id, | 149 QuicStreamId id, |
150 const IOVector& data, | 150 const IOVector& data, |
151 QuicStreamOffset offset, | 151 QuicStreamOffset offset, |
152 bool fin, | 152 bool fin, |
| 153 FecProtection fec_protection, |
153 QuicAckNotifier::DelegateInterface* ack_notifier_delegate) OVERRIDE { | 154 QuicAckNotifier::DelegateInterface* ack_notifier_delegate) OVERRIDE { |
154 // Always consumes everything. | 155 // Always consumes everything. |
155 if (writev_consumes_all_data_) { | 156 if (writev_consumes_all_data_) { |
156 return QuicConsumedData(data.TotalBufferSize(), fin); | 157 return QuicConsumedData(data.TotalBufferSize(), fin); |
157 } else { | 158 } else { |
158 return QuicSession::WritevData(id, data, offset, fin, | 159 return QuicSession::WritevData(id, data, offset, fin, fec_protection, |
159 ack_notifier_delegate); | 160 ack_notifier_delegate); |
160 } | 161 } |
161 } | 162 } |
162 | 163 |
163 void set_writev_consumes_all_data(bool val) { | 164 void set_writev_consumes_all_data(bool val) { |
164 writev_consumes_all_data_ = val; | 165 writev_consumes_all_data_ = val; |
165 } | 166 } |
166 | 167 |
167 QuicConsumedData SendStreamData(QuicStreamId id) { | 168 QuicConsumedData SendStreamData(QuicStreamId id) { |
168 return WritevData(id, IOVector(), 0, true, NULL); | 169 return WritevData(id, IOVector(), 0, true, MAY_FEC_PROTECT, NULL); |
169 } | 170 } |
170 | 171 |
171 using QuicSession::PostProcessAfterData; | 172 using QuicSession::PostProcessAfterData; |
172 | 173 |
173 private: | 174 private: |
174 StrictMock<TestCryptoStream> crypto_stream_; | 175 StrictMock<TestCryptoStream> crypto_stream_; |
175 | 176 |
176 bool writev_consumes_all_data_; | 177 bool writev_consumes_all_data_; |
177 }; | 178 }; |
178 | 179 |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 | 851 |
851 // Version 16 means all flow control is disabled. | 852 // Version 16 means all flow control is disabled. |
852 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_16); | 853 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_16); |
853 EXPECT_FALSE(session_.flow_controller()->IsEnabled()); | 854 EXPECT_FALSE(session_.flow_controller()->IsEnabled()); |
854 EXPECT_FALSE(stream->flow_controller()->IsEnabled()); | 855 EXPECT_FALSE(stream->flow_controller()->IsEnabled()); |
855 } | 856 } |
856 | 857 |
857 } // namespace | 858 } // namespace |
858 } // namespace test | 859 } // namespace test |
859 } // namespace net | 860 } // namespace net |
OLD | NEW |