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

Unified Diff: ppapi/proxy/file_io_resource.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 | « net/quic/quic_time.cc ('k') | storage/browser/fileapi/file_system_operation_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/file_io_resource.cc
diff --git a/ppapi/proxy/file_io_resource.cc b/ppapi/proxy/file_io_resource.cc
index e119dd5c621d51d49865b8339b6134acb3d3113e..1d31ef46e3e02e7850ff3190992c495927055863 100644
--- a/ppapi/proxy/file_io_resource.cc
+++ b/ppapi/proxy/file_io_resource.cc
@@ -4,6 +4,8 @@
#include "ppapi/proxy/file_io_resource.h"
+#include <limits>
+
#include "base/bind.h"
#include "base/task_runner_util.h"
#include "ipc/ipc_message.h"
@@ -289,8 +291,10 @@ int32_t FileIOResource::Write(int64_t offset,
increase = bytes_to_write;
} else {
uint64_t max_offset = offset + bytes_to_write;
- if (max_offset > static_cast<uint64_t>(kint64max))
+ if (max_offset >
+ static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) {
return PP_ERROR_FAILED; // amount calculation would overflow.
+ }
increase = static_cast<int64_t>(max_offset) - max_written_offset_;
}
« no previous file with comments | « net/quic/quic_time.cc ('k') | storage/browser/fileapi/file_system_operation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698