Commit fe8dfb39 authored by Fabrice de Gans-Riberi's avatar Fabrice de Gans-Riberi Committed by Commit Bot

Fuchsia: Prepare for OS_POSIX removal in storage/

This cleans up multi-platform code paths selection and prepares for
the removal of OS_POSIX for the Fuchsia build.

Bug: 836416
Change-Id: I45af4ff9525a3129c077101ad4e365c79490299e
Reviewed-on: https://chromium-review.googlesource.com/1033969Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556950}
parent 42995a35
...@@ -126,7 +126,7 @@ int VfsBackend::DeleteFile(const base::FilePath& file_path, bool sync_dir) { ...@@ -126,7 +126,7 @@ int VfsBackend::DeleteFile(const base::FilePath& file_path, bool sync_dir) {
return SQLITE_IOERR_DELETE; return SQLITE_IOERR_DELETE;
int error_code = SQLITE_OK; int error_code = SQLITE_OK;
#if defined(OS_POSIX) #if defined(OS_POSIX) || defined(OS_FUCHSIA)
if (sync_dir) { if (sync_dir) {
base::File dir(file_path.DirName(), base::File::FLAG_READ); base::File dir(file_path.DirName(), base::File::FLAG_READ);
if (dir.IsValid()) { if (dir.IsValid()) {
...@@ -144,7 +144,7 @@ int VfsBackend::DeleteFile(const base::FilePath& file_path, bool sync_dir) { ...@@ -144,7 +144,7 @@ int VfsBackend::DeleteFile(const base::FilePath& file_path, bool sync_dir) {
uint32_t VfsBackend::GetFileAttributes(const base::FilePath& file_path) { uint32_t VfsBackend::GetFileAttributes(const base::FilePath& file_path) {
#if defined(OS_WIN) #if defined(OS_WIN)
uint32_t attributes = ::GetFileAttributes(file_path.value().c_str()); uint32_t attributes = ::GetFileAttributes(file_path.value().c_str());
#elif defined(OS_POSIX) #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
uint32_t attributes = 0; uint32_t attributes = 0;
if (!access(file_path.value().c_str(), R_OK)) if (!access(file_path.value().c_str(), R_OK))
attributes |= static_cast<uint32_t>(R_OK); attributes |= static_cast<uint32_t>(R_OK);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "net/base/escape.h" #include "net/base/escape.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "storage/common/database/database_identifier.h" #include "storage/common/database/database_identifier.h"
...@@ -324,7 +325,7 @@ std::string GetFileSystemTypeString(FileSystemType type) { ...@@ -324,7 +325,7 @@ std::string GetFileSystemTypeString(FileSystemType type) {
std::string FilePathToString(const base::FilePath& file_path) { std::string FilePathToString(const base::FilePath& file_path) {
#if defined(OS_WIN) #if defined(OS_WIN)
return base::UTF16ToUTF8(file_path.value()); return base::UTF16ToUTF8(file_path.value());
#elif defined(OS_POSIX) #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
return file_path.value(); return file_path.value();
#endif #endif
} }
...@@ -332,7 +333,7 @@ std::string FilePathToString(const base::FilePath& file_path) { ...@@ -332,7 +333,7 @@ std::string FilePathToString(const base::FilePath& file_path) {
base::FilePath StringToFilePath(const std::string& file_path_string) { base::FilePath StringToFilePath(const std::string& file_path_string) {
#if defined(OS_WIN) #if defined(OS_WIN)
return base::FilePath(base::UTF8ToUTF16(file_path_string)); return base::FilePath(base::UTF8ToUTF16(file_path_string));
#elif defined(OS_POSIX) #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
return base::FilePath(file_path_string); return base::FilePath(file_path_string);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment