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

Unified Diff: util/file/file_reader.cc

Issue 1416493006: Change file op |ssize_t|s to FileOperationResult (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 2 months 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/file_reader.h ('k') | util/file/string_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/file/file_reader.cc
diff --git a/util/file/file_reader.cc b/util/file/file_reader.cc
index aad55cf7698b4aff7c7c57145eb39ba1a0e1152c..14d06c74b05671c9817481bdaead971fa14405e2 100644
--- a/util/file/file_reader.cc
+++ b/util/file/file_reader.cc
@@ -21,8 +21,8 @@
namespace crashpad {
bool FileReaderInterface::ReadExactly(void* data, size_t size) {
- ssize_t expect = base::checked_cast<ssize_t>(size);
- ssize_t rv = Read(data, size);
+ FileOperationResult expect = base::checked_cast<FileOperationResult>(size);
+ FileOperationResult rv = Read(data, size);
if (rv < 0) {
// Read() will have logged its own error.
return false;
@@ -41,14 +41,14 @@ WeakFileHandleFileReader::WeakFileHandleFileReader(FileHandle file_handle)
WeakFileHandleFileReader::~WeakFileHandleFileReader() {
}
-ssize_t WeakFileHandleFileReader::Read(void* data, size_t size) {
+FileOperationResult WeakFileHandleFileReader::Read(void* data, size_t size) {
DCHECK_NE(file_handle_, kInvalidFileHandle);
// Don’t use LoggingReadFile(), which insists on a full read and only returns
// a bool. This method permits short reads and returns the number of bytes
// read.
- base::checked_cast<ssize_t>(size);
- ssize_t rv = ReadFile(file_handle_, data, size);
+ base::checked_cast<FileOperationResult>(size);
+ FileOperationResult rv = ReadFile(file_handle_, data, size);
if (rv < 0) {
PLOG(ERROR) << "read";
return -1;
@@ -88,7 +88,7 @@ void FileReader::Close() {
file_.reset();
}
-ssize_t FileReader::Read(void* data, size_t size) {
+FileOperationResult FileReader::Read(void* data, size_t size) {
DCHECK(file_.is_valid());
return weak_file_handle_file_reader_.Read(data, size);
}
@@ -105,7 +105,7 @@ WeakStdioFileReader::WeakStdioFileReader(FILE* file)
WeakStdioFileReader::~WeakStdioFileReader() {
}
-ssize_t WeakStdioFileReader::Read(void* data, size_t size) {
+FileOperationResult WeakStdioFileReader::Read(void* data, size_t size) {
DCHECK(file_);
size_t rv = fread(data, 1, size, file_);
« no previous file with comments | « util/file/file_reader.h ('k') | util/file/string_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698