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

Unified Diff: util/file/string_file_writer.cc

Issue 815053004: Switch [String]FileWriter to use new file_io.h functions/types (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@file_io_seek-2
Patch Set: fixes 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/win/scoped_handle.cc » ('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..e2669b3264c8a011cc127e4e8eb0a412106fca28 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,21 +110,22 @@ off_t StringFileWriter::Seek(off_t offset, int whence) {
return -1;
}
- off_t base_offset_offt;
- if (!AssignIfInRange(&base_offset_offt, base_offset)) {
- LOG(ERROR) << "Seek(): base_offset " << base_offset << " invalid for off_t";
+ FileOffset base_offset_fileoffset;
+ if (!AssignIfInRange(&base_offset_fileoffset, base_offset)) {
+ LOG(ERROR) << "Seek(): base_offset " << base_offset
+ << " invalid for FileOffset";
return -1;
}
- base::CheckedNumeric<off_t> new_offset(base_offset_offt);
+ base::CheckedNumeric<FileOffset> new_offset(base_offset_fileoffset);
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_fileoffset = new_offset.ValueOrDie();
size_t new_offset_sizet;
- if (!AssignIfInRange(&new_offset_sizet, new_offset_offt)) {
- LOG(ERROR) << "Seek(): new_offset " << new_offset_offt
+ if (!AssignIfInRange(&new_offset_sizet, new_offset_fileoffset)) {
+ LOG(ERROR) << "Seek(): new_offset " << new_offset_fileoffset
<< " invalid for size_t";
return -1;
}
« no previous file with comments | « util/file/string_file_writer.h ('k') | util/win/scoped_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698