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

Side by Side Diff: net/disk_cache/blockfile/block_bitmaps_v3.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
OLDNEW
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/disk_cache/blockfile/block_bitmaps_v3.h" 5 #include "net/disk_cache/blockfile/block_bitmaps_v3.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "net/disk_cache/blockfile/disk_format_base.h" 9 #include "net/disk_cache/blockfile/disk_format_base.h"
10 #include "net/disk_cache/blockfile/trace.h" 10 #include "net/disk_cache/blockfile/trace.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 address.num_blocks()); 64 address.num_blocks());
65 } 65 }
66 66
67 void BlockBitmaps::Clear() { 67 void BlockBitmaps::Clear() {
68 bitmaps_.clear(); 68 bitmaps_.clear();
69 } 69 }
70 70
71 void BlockBitmaps::ReportStats() { 71 void BlockBitmaps::ReportStats() {
72 int used_blocks[kFirstAdditionalBlockFile]; 72 int used_blocks[kFirstAdditionalBlockFile];
73 int load[kFirstAdditionalBlockFile]; 73 int load[kFirstAdditionalBlockFile];
74 for (int16 i = 0; i < kFirstAdditionalBlockFile; i++) { 74 for (int16_t i = 0; i < kFirstAdditionalBlockFile; i++) {
75 GetFileStats(i, &used_blocks[i], &load[i]); 75 GetFileStats(i, &used_blocks[i], &load[i]);
76 } 76 }
77 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_0", used_blocks[0]); 77 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_0", used_blocks[0]);
78 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_1", used_blocks[1]); 78 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_1", used_blocks[1]);
79 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_2", used_blocks[2]); 79 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_2", used_blocks[2]);
80 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_3", used_blocks[3]); 80 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_3", used_blocks[3]);
81 81
82 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_0", load[0], 101); 82 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_0", load[0], 101);
83 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_1", load[1], 101); 83 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_1", load[1], 101);
84 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_2", load[2], 101); 84 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_2", load[2], 101);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 *used_count += used; 170 *used_count += used;
171 171
172 index = bitmaps_[index].NextFileId(); 172 index = bitmaps_[index].NextFileId();
173 } while (index); 173 } while (index);
174 174
175 if (max_blocks) 175 if (max_blocks)
176 *load = *used_count * 100 / max_blocks; 176 *load = *used_count * 100 / max_blocks;
177 } 177 }
178 178
179 } // namespace disk_cache 179 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/block_bitmaps_v3.h ('k') | net/disk_cache/blockfile/block_bitmaps_v3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698