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_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
9 | 9 |
10 using base::StringPiece; | 10 using base::StringPiece; |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 CongestionFeedbackMessageInterArrival::CongestionFeedbackMessageInterArrival() { | 268 CongestionFeedbackMessageInterArrival::CongestionFeedbackMessageInterArrival() { |
269 } | 269 } |
270 | 270 |
271 CongestionFeedbackMessageInterArrival:: | 271 CongestionFeedbackMessageInterArrival:: |
272 ~CongestionFeedbackMessageInterArrival() {} | 272 ~CongestionFeedbackMessageInterArrival() {} |
273 | 273 |
274 QuicCongestionFeedbackFrame::QuicCongestionFeedbackFrame() : type(kTCP) {} | 274 QuicCongestionFeedbackFrame::QuicCongestionFeedbackFrame() : type(kTCP) {} |
275 | 275 |
276 QuicCongestionFeedbackFrame::~QuicCongestionFeedbackFrame() {} | 276 QuicCongestionFeedbackFrame::~QuicCongestionFeedbackFrame() {} |
277 | 277 |
| 278 QuicRstStreamErrorCode AdjustErrorForVersion( |
| 279 QuicRstStreamErrorCode error_code, |
| 280 QuicVersion version) { |
| 281 switch (error_code) { |
| 282 case QUIC_RST_FLOW_CONTROL_ACCOUNTING: |
| 283 if (version <= QUIC_VERSION_17) { |
| 284 return QUIC_STREAM_NO_ERROR; |
| 285 } |
| 286 break; |
| 287 default: |
| 288 return error_code; |
| 289 } |
| 290 return error_code; |
| 291 } |
| 292 |
278 QuicRstStreamFrame::QuicRstStreamFrame() | 293 QuicRstStreamFrame::QuicRstStreamFrame() |
279 : stream_id(0), | 294 : stream_id(0), |
280 error_code(QUIC_STREAM_NO_ERROR) { | 295 error_code(QUIC_STREAM_NO_ERROR) { |
281 } | 296 } |
282 | 297 |
283 QuicRstStreamFrame::QuicRstStreamFrame(QuicStreamId stream_id, | 298 QuicRstStreamFrame::QuicRstStreamFrame(QuicStreamId stream_id, |
284 QuicRstStreamErrorCode error_code, | 299 QuicRstStreamErrorCode error_code, |
285 QuicStreamOffset bytes_written) | 300 QuicStreamOffset bytes_written) |
286 : stream_id(stream_id), | 301 : stream_id(stream_id), |
287 error_code(error_code), | 302 error_code(error_code), |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 : bytes_consumed(bytes_consumed), | 730 : bytes_consumed(bytes_consumed), |
716 fin_consumed(fin_consumed) { | 731 fin_consumed(fin_consumed) { |
717 } | 732 } |
718 | 733 |
719 ostream& operator<<(ostream& os, const QuicConsumedData& s) { | 734 ostream& operator<<(ostream& os, const QuicConsumedData& s) { |
720 os << "bytes_consumed: " << s.bytes_consumed | 735 os << "bytes_consumed: " << s.bytes_consumed |
721 << " fin_consumed: " << s.fin_consumed; | 736 << " fin_consumed: " << s.fin_consumed; |
722 return os; | 737 return os; |
723 } | 738 } |
724 | 739 |
| 740 WriteResult::WriteResult() |
| 741 : status(WRITE_STATUS_ERROR), |
| 742 bytes_written(0) { |
| 743 } |
| 744 |
725 WriteResult::WriteResult(WriteStatus status, | 745 WriteResult::WriteResult(WriteStatus status, |
726 int bytes_written_or_error_code) | 746 int bytes_written_or_error_code) |
727 : status(status), | 747 : status(status), |
728 bytes_written(bytes_written_or_error_code) { | 748 bytes_written(bytes_written_or_error_code) { |
729 } | 749 } |
730 | 750 |
731 } // namespace net | 751 } // namespace net |
OLD | NEW |