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

Unified Diff: content/browser/appcache/appcache_internals_ui.cc

Issue 2528243002: Fix silent truncations when extracting values from CheckedNumeric (Closed)
Patch Set: compile cleanup and fix Created 4 years, 1 month 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: content/browser/appcache/appcache_internals_ui.cc
diff --git a/content/browser/appcache/appcache_internals_ui.cc b/content/browser/appcache/appcache_internals_ui.cc
index 41f74ae3f996eef190d830b06ac66ec21117cb37..5ed1fe501c762be328a6fd1fda8de2f8492777eb 100644
--- a/content/browser/appcache/appcache_internals_ui.cc
+++ b/content/browser/appcache/appcache_internals_ui.cc
@@ -287,8 +287,8 @@ void AppCacheInternalsUI::Proxy::OnResponseInfoLoaded(
const int64_t kLimit = 100 * 1000;
int64_t amount_to_read =
std::min(kLimit, response_info->response_data_size());
- scoped_refptr<net::IOBuffer> response_data(new net::IOBuffer(
- base::CheckedNumeric<size_t>(amount_to_read).ValueOrDie()));
+ scoped_refptr<net::IOBuffer> response_data(
+ new net::IOBuffer(base::checked_cast<size_t>(amount_to_read)));
std::unique_ptr<AppCacheResponseReader> reader(
appcache_service_->storage()->CreateResponseReader(
GURL(response_enquiry.manifest_url), response_enquiry.response_id));

Powered by Google App Engine
This is Rietveld 408576698