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

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

Issue 637023002: Misc. cleanup, primarily removing unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove macros.h change Created 6 years, 2 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_util.cc
diff --git a/net/disk_cache/simple/simple_util.cc b/net/disk_cache/simple/simple_util.cc
index 844b695cf7e47ff256d697f161d678ebf0ade28b..55f309ea9b3fbaa65ed5fd5df7727e86f42554aa 100644
--- a/net/disk_cache/simple/simple_util.cc
+++ b/net/disk_cache/simple/simple_util.cc
@@ -9,6 +9,7 @@
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -97,8 +98,7 @@ std::string GetFilenameFromKeyAndFileIndex(const std::string& key,
int32 GetDataSizeFromKeyAndFileSize(const std::string& key, int64 file_size) {
int64 data_size = file_size - key.size() - sizeof(SimpleFileHeader) -
sizeof(SimpleFileEOF);
- DCHECK_GE(implicit_cast<int64>(std::numeric_limits<int32>::max()), data_size);
- return data_size;
+ return base::checked_cast<int32>(data_size);
}
int64 GetFileSizeFromKeyAndDataSize(const std::string& key, int32 data_size) {

Powered by Google App Engine
This is Rietveld 408576698