Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: net/disk_cache/addr.cc

Issue 10148001: Disk Cache: Add more corruption tracking histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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/disk_cache/addr.h" 5 #include "net/disk_cache/addr.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace disk_cache { 9 namespace disk_cache {
10 10
11 int Addr::start_block() const { 11 int Addr::start_block() const {
(...skipping 21 matching lines...) Expand all
33 if (((value_ & kFileTypeMask) >> kFileTypeOffset) > 4) 33 if (((value_ & kFileTypeMask) >> kFileTypeOffset) > 4)
34 return false; 34 return false;
35 35
36 if (is_separate_file()) 36 if (is_separate_file())
37 return true; 37 return true;
38 38
39 const uint32 kReservedBitsMask = 0x0c000000; 39 const uint32 kReservedBitsMask = 0x0c000000;
40 return !(value_ & kReservedBitsMask); 40 return !(value_ & kReservedBitsMask);
41 } 41 }
42 42
43 bool Addr::SanityCheckForEntry() const {
44 if (!SanityCheck() || !is_initialized())
45 return false;
46
47 if (is_separate_file() || file_type() != BLOCK_256)
48 return false;
49
50 return true;
51 }
52
53 bool Addr::SanityCheckForRankings() const {
54 if (!SanityCheck() || !is_initialized())
55 return false;
56
57 if (is_separate_file() || file_type() != RANKINGS || num_blocks() != 1)
58 return false;
59
60 return true;
61 }
62
43 } // namespace disk_cache 63 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698