freebsd-ports/www/chromium/files/patch-ppapi__proxy__file_io_resource.cc
Christoph Moench-Tegeder 0955c59918 Update chromium to 49.0.2623.110
Approved by:	miwi (mentor), rene (mentor)
MFH:		2016Q1
Security:	5c288f68-c7ca-4c0d-b7dc-1ec6295200b3
Security:	f85fa236-e2a6-412e-b5c7-c42120892de5
Security:	8be8ca39-ae70-4422-bf1a-d8fae6911c5e
2016-03-29 20:36:24 +00:00

48 lines
1.7 KiB
C++

--- ppapi/proxy/file_io_resource.cc.orig 2016-03-25 14:04:51.000000000 +0100
+++ ppapi/proxy/file_io_resource.cc 2016-03-29 21:54:44.709418000 +0200
@@ -285,17 +285,19 @@
if (check_quota_) {
int64_t increase = 0;
- uint64_t max_offset = 0;
+ uint64_t _max_offset = 0;
+ // (rene) avoid name collission with /usr/include/vm/vm_map.h on FreeBSD
+ // which also defines max_offset
bool append = (open_flags_ & PP_FILEOPENFLAG_APPEND) != 0;
if (append) {
increase = bytes_to_write;
} else {
- uint64_t max_offset = offset + bytes_to_write;
- if (max_offset >
+ uint64_t _max_offset = offset + bytes_to_write;
+ 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_;
+ increase = static_cast<int64_t>(_max_offset) - max_written_offset_;
}
if (increase > 0) {
@@ -319,7 +321,7 @@
if (append)
append_mode_write_amount_ += bytes_to_write;
else
- max_written_offset_ = max_offset;
+ max_written_offset_ = _max_offset;
}
}
return WriteValidated(offset, buffer, bytes_to_write, callback);
@@ -597,9 +599,9 @@
} else {
DCHECK_LE(offset + bytes_to_write - max_written_offset_, granted);
- int64_t max_offset = offset + bytes_to_write;
- if (max_written_offset_ < max_offset)
- max_written_offset_ = max_offset;
+ int64_t _max_offset = offset + bytes_to_write;
+ if (max_written_offset_ < _max_offset)
+ max_written_offset_ = _max_offset;
}
if (callback->is_blocking()) {