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

Unified Diff: util/file/string_file_writer.cc

Issue 812403002: win: Add open equivalent (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@scoped-handle
Patch Set: Created 6 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 | « util/file/string_file_writer.h ('k') | util/util.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/file/string_file_writer.cc
diff --git a/util/file/string_file_writer.cc b/util/file/string_file_writer.cc
index 5875a327eb0937d4a5d91ed3d2ff398c453b5a74..a7db91e52058ccaa4f0575e112a3ef067d0d0f9c 100644
--- a/util/file/string_file_writer.cc
+++ b/util/file/string_file_writer.cc
@@ -87,7 +87,7 @@ bool StringFileWriter::WriteIoVec(std::vector<WritableIoVec>* iovecs) {
return true;
}
-off_t StringFileWriter::Seek(off_t offset, int whence) {
+FileOffset StringFileWriter::Seek(FileOffset offset, int whence) {
DCHECK(offset_.IsValid());
size_t base_offset;
@@ -110,18 +110,19 @@ off_t StringFileWriter::Seek(off_t offset, int whence) {
return -1;
}
- off_t base_offset_offt;
+ FileOffset base_offset_offt;
if (!AssignIfInRange(&base_offset_offt, base_offset)) {
- LOG(ERROR) << "Seek(): base_offset " << base_offset << " invalid for off_t";
+ LOG(ERROR) << "Seek(): base_offset " << base_offset
+ << " invalid for offset";
return -1;
}
- base::CheckedNumeric<off_t> new_offset(base_offset_offt);
+ base::CheckedNumeric<FileOffset> new_offset(base_offset_offt);
new_offset += offset;
if (!new_offset.IsValid()) {
LOG(ERROR) << "Seek(): new_offset invalid";
return -1;
}
- off_t new_offset_offt = new_offset.ValueOrDie();
+ FileOffset new_offset_offt = new_offset.ValueOrDie();
size_t new_offset_sizet;
if (!AssignIfInRange(&new_offset_sizet, new_offset_offt)) {
LOG(ERROR) << "Seek(): new_offset " << new_offset_offt
« no previous file with comments | « util/file/string_file_writer.h ('k') | util/util.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698