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

Unified Diff: net/disk_cache/simple/simple_synchronous_entry.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/simple/simple_synchronous_entry.h ('k') | net/dns/dns_hosts.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_synchronous_entry.cc
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index 52f8f08c35e1d04b43302f61282543ec4554542f..f85910550ee2e3836d01e07d0df001b1d2c9928b 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -134,8 +134,8 @@ SimpleEntryStat::SimpleEntryStat(base::Time last_used,
int SimpleEntryStat::GetOffsetInFile(const std::string& key,
int offset,
int stream_index) const {
- const int64 headers_size = sizeof(SimpleFileHeader) + key.size();
- const int64 additional_offset =
+ const size_t headers_size = sizeof(SimpleFileHeader) + key.size();
+ const size_t additional_offset =
stream_index == 0 ? data_size_[1] + sizeof(SimpleFileEOF) : 0;
return headers_size + offset + additional_offset;
}
@@ -154,8 +154,9 @@ int SimpleEntryStat::GetLastEOFOffsetInFile(const std::string& key,
return GetOffsetInFile(key, eof_data_offset, stream_index);
}
-int SimpleEntryStat::GetFileSize(const std::string& key, int file_index) const {
- const int total_data_size =
+int64 SimpleEntryStat::GetFileSize(const std::string& key,
+ int file_index) const {
+ const int32 total_data_size =
file_index == 0 ? data_size_[0] + data_size_[1] + sizeof(SimpleFileEOF)
: data_size_[2];
return GetFileSizeFromKeyAndDataSize(key, total_data_size);
@@ -451,7 +452,7 @@ void SimpleSynchronousEntry::ReadSparseData(
void SimpleSynchronousEntry::WriteSparseData(
const EntryOperationData& in_entry_op,
net::IOBuffer* in_buf,
- int64 max_sparse_data_size,
+ uint64 max_sparse_data_size,
SimpleEntryStat* out_entry_stat,
int* out_result) {
DCHECK(initialized_);
@@ -467,7 +468,7 @@ void SimpleSynchronousEntry::WriteSparseData(
return;
}
- int64 sparse_data_size = out_entry_stat->sparse_data_size();
+ uint64 sparse_data_size = out_entry_stat->sparse_data_size();
// This is a pessimistic estimate; it assumes the entire buffer is going to
// be appended as a new range, not written over existing ranges.
if (sparse_data_size + buf_len > max_sparse_data_size) {
« no previous file with comments | « net/disk_cache/simple/simple_synchronous_entry.h ('k') | net/dns/dns_hosts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698