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/core/quic_framer.h" | 5 #include "net/quic/core/quic_framer.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 uint64_t time = ClosestTo( | 793 uint64_t time = ClosestTo( |
794 last_timestamp_.ToMicroseconds(), epoch + time_delta_us, | 794 last_timestamp_.ToMicroseconds(), epoch + time_delta_us, |
795 ClosestTo(last_timestamp_.ToMicroseconds(), prev_epoch + time_delta_us, | 795 ClosestTo(last_timestamp_.ToMicroseconds(), prev_epoch + time_delta_us, |
796 next_epoch + time_delta_us)); | 796 next_epoch + time_delta_us)); |
797 | 797 |
798 return QuicTime::Delta::FromMicroseconds(time); | 798 return QuicTime::Delta::FromMicroseconds(time); |
799 } | 799 } |
800 | 800 |
801 bool QuicFramer::IsValidPath(QuicPathId path_id, | 801 bool QuicFramer::IsValidPath(QuicPathId path_id, |
802 QuicPacketNumber* last_packet_number) { | 802 QuicPacketNumber* last_packet_number) { |
803 if (ContainsKey(closed_paths_, path_id)) { | 803 if (base::ContainsKey(closed_paths_, path_id)) { |
804 // Path is closed. | 804 // Path is closed. |
805 return false; | 805 return false; |
806 } | 806 } |
807 | 807 |
808 if (path_id == last_path_id_) { | 808 if (path_id == last_path_id_) { |
809 *last_packet_number = last_packet_number_; | 809 *last_packet_number = last_packet_number_; |
810 return true; | 810 return true; |
811 } | 811 } |
812 | 812 |
813 if (ContainsKey(last_packet_numbers_, path_id)) { | 813 if (base::ContainsKey(last_packet_numbers_, path_id)) { |
814 *last_packet_number = last_packet_numbers_[path_id]; | 814 *last_packet_number = last_packet_numbers_[path_id]; |
815 } else { | 815 } else { |
816 *last_packet_number = 0; | 816 *last_packet_number = 0; |
817 } | 817 } |
818 | 818 |
819 return true; | 819 return true; |
820 } | 820 } |
821 | 821 |
822 void QuicFramer::SetLastPacketNumber(const QuicPacketHeader& header) { | 822 void QuicFramer::SetLastPacketNumber(const QuicPacketHeader& header) { |
823 if (header.public_header.multipath_flag && header.path_id != last_path_id_) { | 823 if (header.public_header.multipath_flag && header.path_id != last_path_id_) { |
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 | 2706 |
2707 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2707 bool QuicFramer::RaiseError(QuicErrorCode error) { |
2708 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) | 2708 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) |
2709 << " detail: " << detailed_error_; | 2709 << " detail: " << detailed_error_; |
2710 set_error(error); | 2710 set_error(error); |
2711 visitor_->OnError(this); | 2711 visitor_->OnError(this); |
2712 return false; | 2712 return false; |
2713 } | 2713 } |
2714 | 2714 |
2715 } // namespace net | 2715 } // namespace net |
OLD | NEW |