OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/disk_cache/blockfile/index_table_v3.h" | 5 #include "net/disk_cache/blockfile/index_table_v3.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
| 12 #include "base/bit_cast.h" |
12 #include "base/bits.h" | 13 #include "base/bits.h" |
13 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
14 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
15 #include "net/disk_cache/disk_cache.h" | 16 #include "net/disk_cache/disk_cache.h" |
16 | 17 |
17 using base::Time; | 18 using base::Time; |
18 using base::TimeDelta; | 19 using base::TimeDelta; |
19 using disk_cache::CellInfo; | 20 using disk_cache::CellInfo; |
20 using disk_cache::CellList; | 21 using disk_cache::CellList; |
21 using disk_cache::IndexCell; | 22 using disk_cache::IndexCell; |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 bool IndexTable::MisplacedHash(const IndexCell& cell, uint32_t hash) { | 1141 bool IndexTable::MisplacedHash(const IndexCell& cell, uint32_t hash) { |
1141 if (!extra_bits_) | 1142 if (!extra_bits_) |
1142 return false; | 1143 return false; |
1143 | 1144 |
1144 uint32_t mask = (1 << extra_bits_) - 1; | 1145 uint32_t mask = (1 << extra_bits_) - 1; |
1145 hash = small_table_ ? hash >> kSmallTableHashShift : hash >> kHashShift; | 1146 hash = small_table_ ? hash >> kSmallTableHashShift : hash >> kHashShift; |
1146 return (GetHashValue(cell) & mask) != (hash & mask); | 1147 return (GetHashValue(cell) & mask) != (hash & mask); |
1147 } | 1148 } |
1148 | 1149 |
1149 } // namespace disk_cache | 1150 } // namespace disk_cache |
OLD | NEW |