| Index: net/disk_cache/blockfile/file_ios.cc
|
| diff --git a/net/disk_cache/blockfile/file_ios.cc b/net/disk_cache/blockfile/file_ios.cc
|
| index 3ffb5a585671bc32d4f6f6299f98ad709eb5ca05..b00c246953d43619ac8db1d130f4e3975552f329 100644
|
| --- a/net/disk_cache/blockfile/file_ios.cc
|
| +++ b/net/disk_cache/blockfile/file_ios.cc
|
| @@ -4,6 +4,10 @@
|
|
|
| #include "net/disk_cache/blockfile/file.h"
|
|
|
| +#include <stdint.h>
|
| +
|
| +#include <limits>
|
| +
|
| #include "base/bind.h"
|
| #include "base/location.h"
|
| #include "base/logging.h"
|
| @@ -188,8 +192,8 @@ bool File::IsValid() const {
|
|
|
| bool File::Read(void* buffer, size_t buffer_len, size_t offset) {
|
| DCHECK(base_file_.IsValid());
|
| - if (buffer_len > static_cast<size_t>(kint32max) ||
|
| - offset > static_cast<size_t>(kint32max)) {
|
| + if (buffer_len > static_cast<size_t>(std::numeric_limits<int32_t>::max()) ||
|
| + offset > static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
|
| return false;
|
| }
|
|
|
| @@ -199,8 +203,8 @@ bool File::Read(void* buffer, size_t buffer_len, size_t offset) {
|
|
|
| bool File::Write(const void* buffer, size_t buffer_len, size_t offset) {
|
| DCHECK(base_file_.IsValid());
|
| - if (buffer_len > static_cast<size_t>(kint32max) ||
|
| - offset > static_cast<size_t>(kint32max)) {
|
| + if (buffer_len > static_cast<size_t>(std::numeric_limits<int32_t>::max()) ||
|
| + offset > static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
|
| return false;
|
| }
|
|
|
| @@ -244,7 +248,7 @@ bool File::Write(const void* buffer, size_t buffer_len, size_t offset,
|
|
|
| bool File::SetLength(size_t length) {
|
| DCHECK(base_file_.IsValid());
|
| - if (length > kuint32max)
|
| + if (length > std::numeric_limits<uint32_t>::max())
|
| return false;
|
|
|
| return base_file_.SetLength(length);
|
| @@ -252,10 +256,10 @@ bool File::SetLength(size_t length) {
|
|
|
| size_t File::GetLength() {
|
| DCHECK(base_file_.IsValid());
|
| - int64 len = base_file_.GetLength();
|
| + int64_t len = base_file_.GetLength();
|
|
|
| - if (len > static_cast<int64>(kuint32max))
|
| - return kuint32max;
|
| + if (len > static_cast<int64_t>(std::numeric_limits<uint32_t>::max()))
|
| + return std::numeric_limits<uint32_t>::max();
|
|
|
| return static_cast<size_t>(len);
|
| }
|
|
|