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

Unified Diff: chrome/browser/extensions/sandboxed_unpacker.cc

Issue 141113003: Refactor base/safe_numerics.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 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
« no previous file with comments | « chrome/browser/extensions/convert_web_app.cc ('k') | chrome/browser/extensions/test_extension_dir.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/sandboxed_unpacker.cc
===================================================================
--- chrome/browser/extensions/sandboxed_unpacker.cc (revision 245415)
+++ chrome/browser/extensions/sandboxed_unpacker.cc (working copy)
@@ -15,8 +15,8 @@
#include "base/memory/scoped_handle.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
+#include "base/numerics/safe_conversions.h"
#include "base/path_service.h"
-#include "base/safe_numerics.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -628,7 +628,7 @@
base::FilePath manifest_path =
extension_root_.Append(kManifestFilename);
- int size = base::checked_numeric_cast<int>(manifest_json.size());
+ int size = base::checked_cast<int>(manifest_json.size());
if (file_util::WriteFile(manifest_path, manifest_json.data(), size) != size) {
// Error saving manifest.json.
ReportFailure(
@@ -741,7 +741,7 @@
// Note: we're overwriting existing files that the utility process wrote,
// so we can be sure the directory exists.
const char* image_data_ptr = reinterpret_cast<const char*>(&image_data[0]);
- int size = base::checked_numeric_cast<int>(image_data.size());
+ int size = base::checked_cast<int>(image_data.size());
if (file_util::WriteFile(path, image_data_ptr, size) != size) {
// Error saving theme image.
ReportFailure(
@@ -810,7 +810,7 @@
// Note: we're overwriting existing files that the utility process read,
// so we can be sure the directory exists.
- int size = base::checked_numeric_cast<int>(catalog_json.size());
+ int size = base::checked_cast<int>(catalog_json.size());
if (file_util::WriteFile(path, catalog_json.c_str(), size) != size) {
// Error saving catalog.
ReportFailure(
« no previous file with comments | « chrome/browser/extensions/convert_web_app.cc ('k') | chrome/browser/extensions/test_extension_dir.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698