summaryrefslogtreecommitdiffstats
path: root/chromium/base/files/file.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-09-18 14:34:04 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-10-04 11:15:27 +0000
commite6430e577f105ad8813c92e75c54660c4985026e (patch)
tree88115e5d1fb471fea807111924dcccbeadbf9e4f /chromium/base/files/file.h
parent53d399fe6415a96ea6986ec0d402a9c07da72453 (diff)
BASELINE: Update Chromium to 61.0.3163.99
Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/base/files/file.h')
-rw-r--r--chromium/base/files/file.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/chromium/base/files/file.h b/chromium/base/files/file.h
index 0155c7c259e..de5fe0d16ee 100644
--- a/chromium/base/files/file.h
+++ b/chromium/base/files/file.h
@@ -12,36 +12,23 @@
#include "base/base_export.h"
#include "base/files/file_path.h"
#include "base/files/file_tracing.h"
+#include "base/files/platform_file.h"
#include "base/files/scoped_file.h"
#include "base/macros.h"
#include "base/time/time.h"
#include "build/build_config.h"
-#if defined(OS_WIN)
-#include <windows.h>
-#include "base/win/scoped_handle.h"
-#endif
-
#if defined(OS_POSIX)
#include <sys/stat.h>
#endif
namespace base {
-#if defined(OS_WIN)
-using PlatformFile = HANDLE;
-
-const PlatformFile kInvalidPlatformFile = INVALID_HANDLE_VALUE;
-#elif defined(OS_POSIX)
-using PlatformFile = int;
-
-const PlatformFile kInvalidPlatformFile = -1;
#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL)
typedef struct stat stat_wrapper_t;
-#else
+#elif defined(OS_POSIX)
typedef struct stat64 stat_wrapper_t;
#endif
-#endif // defined(OS_POSIX)
// Thin wrapper around an OS-level file.
// Note that this class does not provide any support for asynchronous IO, other
@@ -273,6 +260,8 @@ class BASE_EXPORT File {
// Returns some basic information for the given file.
bool GetInfo(Info* info);
+#if !defined(OS_FUCHSIA) // Fuchsia's POSIX API does not support file locking.
+
// Attempts to take an exclusive write lock on the file. Returns immediately
// (i.e. does not wait for another process to unlock the file). If the lock
// was obtained, the result will be FILE_OK. A lock only guarantees
@@ -298,6 +287,8 @@ class BASE_EXPORT File {
// Unlock a file previously locked.
Error Unlock();
+#endif // !defined(OS_FUCHSIA)
+
// Returns a new object referencing this file for use within the current
// process. Handling of FLAG_DELETE_ON_CLOSE varies by OS. On POSIX, the File
// object that was created or initialized with this flag will have unlinked
@@ -355,11 +346,7 @@ class BASE_EXPORT File {
void SetPlatformFile(PlatformFile file);
-#if defined(OS_WIN)
- win::ScopedHandle file_;
-#elif defined(OS_POSIX)
- ScopedFD file_;
-#endif
+ ScopedPlatformFile file_;
// A path to use for tracing purposes. Set if file tracing is enabled during
// |Initialize()|.