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

Unified Diff: net/disk_cache/blockfile/block_files.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/blockfile/block_files.h ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/block_files.cc
diff --git a/net/disk_cache/blockfile/block_files.cc b/net/disk_cache/blockfile/block_files.cc
index 4ae217be40f5f13642439cd27d37a55216984d37..58d25da97900a6c0d0b75910f5a9e36489af40cf 100644
--- a/net/disk_cache/blockfile/block_files.cc
+++ b/net/disk_cache/blockfile/block_files.cc
@@ -28,7 +28,7 @@ const char s_types[16] = {4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0};
// Returns the type of block (number of consecutive blocks that can be stored)
// for a given nibble of the bitmap.
-inline int GetMapBlockType(uint8 value) {
+inline int GetMapBlockType(uint32 value) {
value &= 0xf;
return s_types[value];
}
@@ -279,7 +279,7 @@ bool BlockFiles::Init(bool create_files) {
thread_checker_.reset(new base::ThreadChecker);
block_files_.resize(kFirstAdditionalBlockFile);
- for (int i = 0; i < kFirstAdditionalBlockFile; i++) {
+ for (int16 i = 0; i < kFirstAdditionalBlockFile; i++) {
if (create_files)
if (!CreateBlockFile(i, static_cast<FileType>(i + 1), true))
return false;
@@ -574,7 +574,7 @@ MappedFile* BlockFiles::FileForNewBlock(FileType block_type, int block_count) {
MappedFile* BlockFiles::NextFile(MappedFile* file) {
ScopedFlush flush(file);
BlockFileHeader* header = reinterpret_cast<BlockFileHeader*>(file->buffer());
- int new_file = header->next_file;
+ int16 new_file = header->next_file;
if (!new_file) {
// RANKINGS is not reported as a type for small entries, but we may be
// extending the rankings block file.
@@ -595,8 +595,8 @@ MappedFile* BlockFiles::NextFile(MappedFile* file) {
return GetFile(address);
}
-int BlockFiles::CreateNextBlockFile(FileType block_type) {
- for (int i = kFirstAdditionalBlockFile; i <= kMaxBlockFile; i++) {
+int16 BlockFiles::CreateNextBlockFile(FileType block_type) {
+ for (int16 i = kFirstAdditionalBlockFile; i <= kMaxBlockFile; i++) {
if (CreateBlockFile(i, block_type, false))
return i;
}
« no previous file with comments | « net/disk_cache/blockfile/block_files.h ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698