Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/crypto/strike_register.h" | 5 #include "net/quic/crypto/strike_register.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 488 | 488 |
| 489 CHECK_EQ(free_internal_nodes.count(internal_node), 0u); | 489 CHECK_EQ(free_internal_nodes.count(internal_node), 0u); |
| 490 | 490 |
| 491 for (unsigned child = 0; child < 2; child++) { | 491 for (unsigned child = 0; child < 2; child++) { |
| 492 if (i->child(child) & kExternalFlag) { | 492 if (i->child(child) & kExternalFlag) { |
| 493 uint32 ext = i->child(child) & ~kExternalFlag; | 493 uint32 ext = i->child(child) & ~kExternalFlag; |
| 494 CHECK_EQ(free_external_nodes.count(ext), 0u); | 494 CHECK_EQ(free_external_nodes.count(ext), 0u); |
| 495 CHECK_EQ(used_external_nodes->count(ext), 0u); | 495 CHECK_EQ(used_external_nodes->count(ext), 0u); |
| 496 used_external_nodes->insert(ext); | 496 used_external_nodes->insert(ext); |
| 497 const uint8* bytes = external_node(ext); | 497 const uint8* bytes = external_node(ext); |
| 498 for (vector<pair<unsigned, bool> >::const_iterator i = bits.begin(); | 498 for (vector<pair<unsigned, bool>>::const_iterator j = bits.begin(); |
| 499 i != bits.end(); i++) { | 499 j != bits.end(); j++) { |
| 500 unsigned byte = i->first / 8; | 500 unsigned byte = j->first / 8; |
| 501 DCHECK_LE(byte, 0xffu); | 501 DCHECK_LE(byte, 0xffu); |
| 502 unsigned bit = i->first % 8; | 502 bit = j->first % 8; |
|
ramant (doing other things)
2015/02/20 20:04:07
IMO, we should define a "unsigned bit_new = ..." a
scottmg
2015/02/20 20:30:51
Shoot, I didn't notice it might be used in the els
| |
| 503 static const uint8 kMasks[8] = | 503 static const uint8 kMasks[8] = |
| 504 {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; | 504 {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; |
| 505 CHECK_EQ((bytes[byte] & kMasks[bit]) != 0, i->second); | 505 CHECK_EQ((bytes[byte] & kMasks[bit]) != 0, j->second); |
| 506 } | 506 } |
| 507 } else { | 507 } else { |
| 508 uint32 inter = i->child(child); | 508 uint32 inter = i->child(child); |
| 509 vector<pair<unsigned, bool> > new_bits(bits); | 509 vector<pair<unsigned, bool> > new_bits(bits); |
| 510 new_bits.push_back(pair<unsigned, bool>(bit, child != 0)); | 510 new_bits.push_back(pair<unsigned, bool>(bit, child != 0)); |
| 511 CHECK_EQ(free_internal_nodes.count(inter), 0u); | 511 CHECK_EQ(free_internal_nodes.count(inter), 0u); |
| 512 CHECK_EQ(used_internal_nodes->count(inter), 0u); | 512 CHECK_EQ(used_internal_nodes->count(inter), 0u); |
| 513 used_internal_nodes->insert(inter); | 513 used_internal_nodes->insert(inter); |
| 514 ValidateTree(inter, bit, bits, free_internal_nodes, free_external_nodes, | 514 ValidateTree(inter, bit, bits, free_internal_nodes, free_external_nodes, |
| 515 used_internal_nodes, used_external_nodes); | 515 used_internal_nodes, used_external_nodes); |
| 516 } | 516 } |
| 517 } | 517 } |
| 518 } | 518 } |
| 519 | 519 |
| 520 } // namespace net | 520 } // namespace net |
| OLD | NEW |