summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/quota_file_io.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/plugins/ppapi/quota_file_io.cc')
-rw-r--r--webkit/plugins/ppapi/quota_file_io.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/quota_file_io.cc b/webkit/plugins/ppapi/quota_file_io.cc
index d5af70b..2e628c7 100644
--- a/webkit/plugins/ppapi/quota_file_io.cc
+++ b/webkit/plugins/ppapi/quota_file_io.cc
@@ -4,6 +4,8 @@
#include "webkit/plugins/ppapi/quota_file_io.h"
+#include <algorithm>
+
#include "base/stl_util.h"
#include "base/message_loop_proxy.h"
#include "base/task.h"
@@ -222,6 +224,8 @@ QuotaFileIO::~QuotaFileIO() {
bool QuotaFileIO::Write(
int64_t offset, const char* buffer, int32_t bytes_to_write,
WriteCallback* callback) {
+ if (bytes_to_write <= 0)
+ return false;
WriteOperation* op = new WriteOperation(
this, false, offset, buffer, bytes_to_write, callback);
return RegisterOperationForQuotaChecks(op);