| 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_fec_group.h" | 5 #include "net/quic/quic_fec_group.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 for (size_t i = 0; i < kMaxPacketSize; ++i) { | 157 for (size_t i = 0; i < kMaxPacketSize; ++i) { |
| 158 uint8 byte = i < payload.size() ? payload[i] : 0x00; | 158 uint8 byte = i < payload.size() ? payload[i] : 0x00; |
| 159 payload_parity_[i] ^= byte; | 159 payload_parity_[i] ^= byte; |
| 160 } | 160 } |
| 161 return true; | 161 return true; |
| 162 } | 162 } |
| 163 | 163 |
| 164 size_t QuicFecGroup::NumMissingPackets() const { | 164 size_t QuicFecGroup::NumMissingPackets() const { |
| 165 if (min_protected_packet_ == kNoSequenceNumber) | 165 if (min_protected_packet_ == kNoSequenceNumber) |
| 166 return numeric_limits<size_t>::max(); | 166 return numeric_limits<size_t>::max(); |
| 167 return (max_protected_packet_ - min_protected_packet_ + 1) - | 167 return static_cast<size_t>( |
| 168 received_packets_.size(); | 168 (max_protected_packet_ - min_protected_packet_ + 1) - |
| 169 received_packets_.size()); |
| 169 } | 170 } |
| 170 | 171 |
| 171 } // namespace net | 172 } // namespace net |
| OLD | NEW |