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

Unified Diff: util/file/file_io.h

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 | « tools/generate_dump.cc ('k') | util/file/file_writer.h » ('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 2c59f598883e70cf1825067d40e515b63487bb34..901566c79db3cc4b07ba5f980eadf0d4202d1b1c 100644
--- a/util/file/file_io.h
+++ b/util/file/file_io.h
@@ -19,8 +19,11 @@
#include "build/build_config.h"
-#if defined(OS_WIN)
+#if defined(OS_POSIX)
+#include "base/files/scoped_file.h"
+#elif defined(OS_WIN)
#include <windows.h>
+#include "util/win/scoped_handle.h"
#endif
namespace base {
@@ -37,10 +40,14 @@ using FileHandle = int;
//! \brief Platform-specific alias for a position in an open file.
using FileOffset = off_t;
+//! \brief Scoped wrapper of a FileHandle.
+using ScopedFileHandle = base::ScopedFD;
+
#elif defined(OS_WIN)
using FileHandle = HANDLE;
using FileOffset = LONGLONG;
+using ScopedFileHandle = ScopedFileHANDLE;
#endif
@@ -152,8 +159,7 @@ void CheckedReadFileAtEOF(FileHandle file);
//!
//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
//!
-//! \sa ScopedFD
-//! \sa ScopedFileHANDLE
+//! \sa ScopedFileHandle
FileHandle LoggingOpenFileForRead(const base::FilePath& path);
//! \brief Wraps `open()` or `CreateFile()`, creating a file for output. Logs
@@ -168,8 +174,7 @@ FileHandle LoggingOpenFileForRead(const base::FilePath& path);
//! \return The newly opened FileHandle, or an invalid FileHandle on failure.
//!
//! \sa FileWriteMode
-//! \sa ScopedFD
-//! \sa ScopedFileHANDLE
+//! \sa ScopedFileHandle
FileHandle LoggingOpenFileForWrite(const base::FilePath& path,
FileWriteMode write_mode,
bool world_readable);
« no previous file with comments | « tools/generate_dump.cc ('k') | util/file/file_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698