summaryrefslogtreecommitdiffstats
path: root/chromium/base/files/file_util.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-08-24 12:15:48 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-08-28 13:30:04 +0000
commitb014812705fc80bff0a5c120dfcef88f349816dc (patch)
tree25a2e2d9fa285f1add86aa333389a839f81a39ae /chromium/base/files/file_util.h
parent9f4560b1027ae06fdb497023cdcaf91b8511fa74 (diff)
BASELINE: Update Chromium to 68.0.3440.125
Change-Id: I23f19369e01f688e496f5bf179abb521ad73874f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/files/file_util.h')
-rw-r--r--chromium/base/files/file_util.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/chromium/base/files/file_util.h b/chromium/base/files/file_util.h
index cd8a1ba5953..1ba93681727 100644
--- a/chromium/base/files/file_util.h
+++ b/chromium/base/files/file_util.h
@@ -16,6 +16,11 @@
#include <string>
#include <vector>
+#if defined(OS_POSIX) || defined(OS_FUCHSIA)
+#include <sys/stat.h>
+#include <unistd.h>
+#endif
+
#include "base/base_export.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
@@ -24,12 +29,7 @@
#if defined(OS_WIN)
#include "base/win/windows_types.h"
-#elif defined(OS_POSIX)
-#include <sys/stat.h>
-#include <unistd.h>
-#endif
-
-#if defined(OS_POSIX)
+#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
#include "base/file_descriptor_posix.h"
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
@@ -178,7 +178,7 @@ BASE_EXPORT bool ReadFileToStringWithMaxSize(const FilePath& path,
std::string* contents,
size_t max_size);
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Read exactly |bytes| bytes from file descriptor |fd|, storing the result
// in |buffer|. This function is protected against EINTR and partial reads.
@@ -191,9 +191,9 @@ BASE_EXPORT bool ReadFromFD(int fd, char* buffer, size_t bytes);
BASE_EXPORT int CreateAndOpenFdForTemporaryFileInDir(const FilePath& dir,
FilePath* path);
-// The following functions use POSIX functionality that isn't supported by
-// Fuchsia.
-#if !defined(OS_FUCHSIA)
+#endif // OS_POSIX || OS_FUCHSIA
+
+#if defined(OS_POSIX)
// Creates a symbolic link at |symlink| pointing to |target|. Returns
// false on failure.
@@ -235,7 +235,6 @@ BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path, int mode);
BASE_EXPORT bool ExecutableExistsInPath(Environment* env,
const FilePath::StringType& executable);
-#endif // !OS_FUCHSIA
#endif // OS_POSIX
// Returns true if the given directory is empty
@@ -363,7 +362,7 @@ BASE_EXPORT int ReadFile(const FilePath& filename, char* data, int max_size);
BASE_EXPORT int WriteFile(const FilePath& filename, const char* data,
int size);
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Appends |data| to |fd|. Does not close |fd| when done. Returns true iff
// |size| bytes of |data| were written to |fd|.
BASE_EXPORT bool WriteFileDescriptor(const int fd, const char* data, int size);
@@ -393,7 +392,7 @@ BASE_EXPORT int GetUniquePathNumber(const FilePath& path,
// false.
BASE_EXPORT bool SetNonBlocking(int fd);
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Creates a non-blocking, close-on-exec pipe.
// This creates a non-blocking pipe that is not intended to be shared with any
// child process. This will be done atomically if the operating system supports
@@ -420,7 +419,7 @@ BASE_EXPORT bool VerifyPathControlledByUser(const base::FilePath& base,
const base::FilePath& path,
uid_t owner_uid,
const std::set<gid_t>& group_gids);
-#endif // defined(OS_POSIX)
+#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
#if defined(OS_MACOSX) && !defined(OS_IOS)
// Is |path| writable only by a user with administrator privileges?
@@ -457,7 +456,7 @@ enum FileSystemType {
BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type);
#endif
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) || defined(OS_FUCHSIA)
// Get a temporary directory for shared memory files. The directory may depend
// on whether the destination is intended for executable files, which in turn
// depends on how /dev/shmem was mounted. As a result, you must supply whether