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

Unified Diff: net/disk_cache/simple/simple_synchronous_entry.cc

Issue 1340683002: Remove base's implicit_cast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implicitcast: numericstest Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
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 2c0412db17f061e11e940113556a026418a05b55..f6f0c71717d4579812ae11907697f44297e4d14e 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -939,7 +939,7 @@ int SimpleSynchronousEntry::InitializeForOpen(
scoped_ptr<char[]> key(new char[header.key_length]);
int key_read_result = files_[i].Read(sizeof(header), key.get(),
header.key_length);
- if (key_read_result != implicit_cast<int>(header.key_length)) {
+ if (key_read_result != base::checked_cast<int>(header.key_length)) {
DLOG(WARNING) << "Cannot read key from entry.";
RecordSyncOpenResult(cache_type_, OPEN_ENTRY_CANT_READ_KEY, had_index);
return net::ERR_FAILED;
@@ -1018,7 +1018,7 @@ bool SimpleSynchronousEntry::InitializeCreatedFile(
bytes_written = files_[file_index].Write(sizeof(header), key_.data(),
key_.size());
- if (bytes_written != implicit_cast<int>(key_.size())) {
+ if (bytes_written != base::checked_cast<int>(key_.size())) {
*out_result = CREATE_ENTRY_CANT_WRITE_KEY;
return false;
}
@@ -1248,7 +1248,7 @@ bool SimpleSynchronousEntry::InitializeSparseFile() {
int key_write_result = sparse_file_.Write(sizeof(header), key_.data(),
key_.size());
- if (key_write_result != implicit_cast<int>(key_.size())) {
+ if (key_write_result != base::checked_cast<int>(key_.size())) {
DLOG(WARNING) << "Could not write sparse file key";
return false;
}
@@ -1378,7 +1378,7 @@ bool SimpleSynchronousEntry::WriteSparseRange(SparseRange* range,
int bytes_written = sparse_file_.Write(range->file_offset - sizeof(header),
reinterpret_cast<char*>(&header),
sizeof(header));
- if (bytes_written != implicit_cast<int>(sizeof(header))) {
+ if (bytes_written != base::checked_cast<int>(sizeof(header))) {
DLOG(WARNING) << "Could not rewrite sparse range header.";
return false;
}
@@ -1413,7 +1413,7 @@ bool SimpleSynchronousEntry::AppendSparseRange(int64 offset,
int bytes_written = sparse_file_.Write(sparse_tail_offset_,
reinterpret_cast<char*>(&header),
sizeof(header));
- if (bytes_written != implicit_cast<int>(sizeof(header))) {
+ if (bytes_written != base::checked_cast<int>(sizeof(header))) {
DLOG(WARNING) << "Could not append sparse range header.";
return false;
}
« no previous file with comments | « net/disk_cache/simple/simple_index_file_unittest.cc ('k') | net/disk_cache/simple/simple_version_upgrade_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698