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

Unified Diff: storage/browser/fileapi/sandbox_file_stream_writer.cc

Issue 1498003003: Remove kint64max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: INT64_MAX Created 5 years 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 | « storage/browser/fileapi/sandbox_file_stream_writer.h ('k') | storage/browser/quota/quota_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/fileapi/sandbox_file_stream_writer.cc
diff --git a/storage/browser/fileapi/sandbox_file_stream_writer.cc b/storage/browser/fileapi/sandbox_file_stream_writer.cc
index d6895c894761c80cb5d741626f82ee25c305ffde..de950fecf9039504431c65eebf1aae2c1e3342ce 100644
--- a/storage/browser/fileapi/sandbox_file_stream_writer.cc
+++ b/storage/browser/fileapi/sandbox_file_stream_writer.cc
@@ -4,6 +4,8 @@
#include "storage/browser/fileapi/sandbox_file_stream_writer.h"
+#include <limits>
+
#include "base/files/file_util_proxy.h"
#include "base/sequenced_task_runner.h"
#include "base/trace_event/trace_event.h"
@@ -24,14 +26,14 @@ namespace {
// |file_offset| < |file_size|) to make the remaining quota calculation easier.
// Specifically this widens the quota for overlapping range (so that we can
// simply compare written bytes against the adjusted quota).
-int64 AdjustQuotaForOverlap(int64 quota,
- int64 file_offset,
- int64 file_size) {
+int64_t AdjustQuotaForOverlap(int64_t quota,
+ int64_t file_offset,
+ int64_t file_size) {
DCHECK_LE(file_offset, file_size);
if (quota < 0)
quota = 0;
- int64 overlap = file_size - file_offset;
- if (kint64max - overlap > quota)
+ int64_t overlap = file_size - file_offset;
+ if (std::numeric_limits<int64_t>::max() - overlap > quota)
quota += overlap;
return quota;
}
@@ -41,7 +43,7 @@ int64 AdjustQuotaForOverlap(int64 quota,
SandboxFileStreamWriter::SandboxFileStreamWriter(
FileSystemContext* file_system_context,
const FileSystemURL& url,
- int64 initial_offset,
+ int64_t initial_offset,
const UpdateObserverList& observers)
: file_system_context_(file_system_context),
url_(url),
@@ -51,7 +53,7 @@ SandboxFileStreamWriter::SandboxFileStreamWriter(
total_bytes_written_(0),
allowed_bytes_to_write_(0),
has_pending_operation_(false),
- default_quota_(kint64max),
+ default_quota_(std::numeric_limits<int64_t>::max()),
weak_factory_(this) {
DCHECK(url_.is_valid());
}
@@ -166,8 +168,8 @@ void SandboxFileStreamWriter::DidCreateSnapshotFile(
void SandboxFileStreamWriter::DidGetUsageAndQuota(
const net::CompletionCallback& callback,
storage::QuotaStatusCode status,
- int64 usage,
- int64 quota) {
+ int64_t usage,
+ int64_t quota) {
if (CancelIfRequested())
return;
if (status != storage::kQuotaStatusOk) {
« no previous file with comments | « storage/browser/fileapi/sandbox_file_stream_writer.h ('k') | storage/browser/quota/quota_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698