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

Unified Diff: util/file/file_writer.cc

Issue 936153002: Add FileReaderInterface. Move StringFileWriter to StringFile and (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Remove unused #include Created 5 years, 10 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_writer.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_writer.cc
diff --git a/util/file/file_writer.cc b/util/file/file_writer.cc
index 1b6ba0d4a1079ad87d3c5e89fca22a97404eb604..aedcd5dce3bb01e853a7c67c82749ebf6f241658 100644
--- a/util/file/file_writer.cc
+++ b/util/file/file_writer.cc
@@ -19,6 +19,8 @@
#include <limits.h>
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
+#include "build/build_config.h"
#if defined(OS_POSIX)
#include <sys/uio.h>
@@ -46,18 +48,7 @@ WeakFileHandleFileWriter::~WeakFileHandleFileWriter() {
bool WeakFileHandleFileWriter::Write(const void* data, size_t size) {
DCHECK_NE(file_handle_, kInvalidFileHandle);
-
- // TODO(mark): Write no more than SSIZE_MAX bytes in a single call.
- ssize_t written = WriteFile(file_handle_, data, size);
- if (written < 0) {
- PLOG(ERROR) << "write";
- return false;
- } else if (written == 0) {
- LOG(ERROR) << "write: returned 0";
- return false;
- }
-
- return true;
+ return LoggingWriteFile(file_handle_, data, size);
}
bool WeakFileHandleFileWriter::WriteIoVec(std::vector<WritableIoVec>* iovecs) {
« no previous file with comments | « util/file/file_writer.h ('k') | util/file/string_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698