| Index: chrome/browser/media_galleries/linux/snapshot_file_details.cc
|
| diff --git a/chrome/browser/media_galleries/linux/snapshot_file_details.cc b/chrome/browser/media_galleries/linux/snapshot_file_details.cc
|
| index e2408badef834c74e13c28e66f285bb14f3a784e..1058fd59839d712c3a0f7c399c76151b449610b3 100644
|
| --- a/chrome/browser/media_galleries/linux/snapshot_file_details.cc
|
| +++ b/chrome/browser/media_galleries/linux/snapshot_file_details.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "chrome/browser/media_galleries/linux/snapshot_file_details.h"
|
|
|
| +#include <limits>
|
| +
|
| #include "base/numerics/safe_conversions.h"
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| @@ -11,7 +13,7 @@
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| SnapshotRequestInfo::SnapshotRequestInfo(
|
| - uint32 file_id,
|
| + uint32_t file_id,
|
| const base::FilePath& snapshot_file_path,
|
| const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback&
|
| success_callback,
|
| @@ -19,8 +21,7 @@ SnapshotRequestInfo::SnapshotRequestInfo(
|
| : file_id(file_id),
|
| snapshot_file_path(snapshot_file_path),
|
| success_callback(success_callback),
|
| - error_callback(error_callback) {
|
| -}
|
| + error_callback(error_callback) {}
|
|
|
| SnapshotRequestInfo::~SnapshotRequestInfo() {
|
| }
|
| @@ -45,9 +46,9 @@ void SnapshotFileDetails::set_error_occurred(bool error) {
|
| error_occurred_ = error;
|
| }
|
|
|
| -bool SnapshotFileDetails::AddBytesWritten(uint32 bytes_written) {
|
| +bool SnapshotFileDetails::AddBytesWritten(uint32_t bytes_written) {
|
| if ((bytes_written == 0) ||
|
| - (bytes_written_ > kuint32max - bytes_written) ||
|
| + (bytes_written_ > std::numeric_limits<uint32_t>::max() - bytes_written) ||
|
| (bytes_written_ + bytes_written > file_info_.size))
|
| return false;
|
|
|
| @@ -59,10 +60,10 @@ bool SnapshotFileDetails::IsSnapshotFileWriteComplete() const {
|
| return !error_occurred_ && (bytes_written_ == file_info_.size);
|
| }
|
|
|
| -uint32 SnapshotFileDetails::BytesToRead() const {
|
| +uint32_t SnapshotFileDetails::BytesToRead() const {
|
| // Read data in 1MB chunks.
|
| - static const uint32 kReadChunkSize = 1024 * 1024;
|
| + static const uint32_t kReadChunkSize = 1024 * 1024;
|
| return std::min(
|
| kReadChunkSize,
|
| - base::checked_cast<uint32>(file_info_.size) - bytes_written_);
|
| + base::checked_cast<uint32_t>(file_info_.size) - bytes_written_);
|
| }
|
|
|