| Index: net/disk_cache/addr.cc
|
| ===================================================================
|
| --- net/disk_cache/addr.cc (revision 133063)
|
| +++ net/disk_cache/addr.cc (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -40,4 +40,24 @@
|
| return !(value_ & kReservedBitsMask);
|
| }
|
|
|
| +bool Addr::SanityCheckForEntry() const {
|
| + if (!SanityCheck() || !is_initialized())
|
| + return false;
|
| +
|
| + if (is_separate_file() || file_type() != BLOCK_256)
|
| + return false;
|
| +
|
| + return true;
|
| +}
|
| +
|
| +bool Addr::SanityCheckForRankings() const {
|
| + if (!SanityCheck() || !is_initialized())
|
| + return false;
|
| +
|
| + if (is_separate_file() || file_type() != RANKINGS || num_blocks() != 1)
|
| + return false;
|
| +
|
| + return true;
|
| +}
|
| +
|
| } // namespace disk_cache
|
|
|