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

Unified Diff: util/file/file_io.h

Issue 1395543002: Add non-logging OpenFileForWrite() and OpenFileForReadAndWrite() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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 | « no previous file | util/file/file_io_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/file/file_io.h
diff --git a/util/file/file_io.h b/util/file/file_io.h
index 7bc9673538be3eb695f78c82973b6f7629ae5af6..ec89d62b556afd35ae97b6318eb5c98d907d84ad 100644
--- a/util/file/file_io.h
+++ b/util/file/file_io.h
@@ -202,15 +202,17 @@ void CheckedWriteFile(FileHandle file, const void* buffer, size_t size);
void CheckedReadFileAtEOF(FileHandle file);
//! \brief Wraps `open()` or `CreateFile()`, opening an existing file for
-//! reading. Logs an error if the operation fails.
+//! reading.
//!
//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
//!
//! \sa ScopedFileHandle
-FileHandle LoggingOpenFileForRead(const base::FilePath& path);
+//! \sa OpenFileForWrite
+//! \sa OpenFileForReadAndWrite
+//! \sa LoggingOpenFileForRead
+FileHandle OpenFileForRead(const base::FilePath& path);
-//! \brief Wraps `open()` or `CreateFile()`, creating a file for output. Logs
-//! an error if the operation fails.
+//! \brief Wraps `open()` or `CreateFile()`, creating a file for output.
//!
//! \a mode determines the style (truncate, reuse, etc.) that is used to open
//! the file. On POSIX, \a permissions determines the value that is passed as
@@ -220,15 +222,16 @@ FileHandle LoggingOpenFileForRead(const base::FilePath& path);
//!
//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
//!
-//! \sa FileWriteMode
-//! \sa FilePermissions
//! \sa ScopedFileHandle
-FileHandle LoggingOpenFileForWrite(const base::FilePath& path,
- FileWriteMode mode,
- FilePermissions permissions);
+//! \sa OpenFileForRead
+//! \sa OpenFileForReadAndWrite
+//! \sa LoggingOpenFileForWrite
+FileHandle OpenFileForWrite(const base::FilePath& path,
+ FileWriteMode mode,
+ FilePermissions permissions);
//! \brief Wraps `open()` or `CreateFile()`, creating a file for both input and
-//! output. Logs an error if the operation fails.
+//! output.
//!
//! \a mode determines the style (truncate, reuse, etc.) that is used to open
//! the file. On POSIX, \a permissions determines the value that is passed as
@@ -238,9 +241,42 @@ FileHandle LoggingOpenFileForWrite(const base::FilePath& path,
//!
//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
//!
-//! \sa FileWriteMode
-//! \sa FilePermissions
//! \sa ScopedFileHandle
+//! \sa OpenFileForRead
+//! \sa OpenFileForWrite
+//! \sa LoggingOpenFileForReadAndWrite
+FileHandle OpenFileForReadAndWrite(const base::FilePath& path,
+ FileWriteMode mode,
+ FilePermissions permissions);
+
+//! \brief Wraps OpenFileForRead(), logging an error if the operation fails.
+//!
+//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
+//!
+//! \sa ScopedFileHandle
+//! \sa LoggingOpenFileForWrite
+//! \sa LoggingOpenFileForReadAndWrite
+FileHandle LoggingOpenFileForRead(const base::FilePath& path);
+
+//! \brief Wraps OpenFileForWrite(), logging an error if the operation fails.
+//!
+//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
+//!
+//! \sa ScopedFileHandle
+//! \sa LoggingOpenFileForRead
+//! \sa LoggingOpenFileForReadAndWrite
+FileHandle LoggingOpenFileForWrite(const base::FilePath& path,
+ FileWriteMode mode,
+ FilePermissions permissions);
+
+//! \brief Wraps OpenFileForReadAndWrite(), logging an error if the operation
+//! fails.
+//!
+//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
+//!
+//! \sa ScopedFileHandle
+//! \sa LoggingOpenFileForRead
+//! \sa LoggingOpenFileForWrite
FileHandle LoggingOpenFileForReadAndWrite(const base::FilePath& path,
FileWriteMode mode,
FilePermissions permissions);
« no previous file with comments | « no previous file | util/file/file_io_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698