Skip to content

Commit

Permalink
Fuchsia: Prepare for OS_POSIX removal in storage/
Browse files Browse the repository at this point in the history
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/1033969
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556950}
  • Loading branch information
Steelskin authored and Commit Bot committed May 8, 2018
1 parent 42995a3 commit fe8dfb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions storage/browser/database/vfs_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int VfsBackend::DeleteFile(const base::FilePath& file_path, bool sync_dir) {
return SQLITE_IOERR_DELETE;

int error_code = SQLITE_OK;
#if defined(OS_POSIX)
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
if (sync_dir) {
base::File dir(file_path.DirName(), base::File::FLAG_READ);
if (dir.IsValid()) {
Expand All @@ -144,7 +144,7 @@ int VfsBackend::DeleteFile(const base::FilePath& file_path, bool sync_dir) {
uint32_t VfsBackend::GetFileAttributes(const base::FilePath& file_path) {
#if defined(OS_WIN)
uint32_t attributes = ::GetFileAttributes(file_path.value().c_str());
#elif defined(OS_POSIX)
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
uint32_t attributes = 0;
if (!access(file_path.value().c_str(), R_OK))
attributes |= static_cast<uint32_t>(R_OK);
Expand Down
5 changes: 3 additions & 2 deletions storage/common/fileapi/file_system_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "net/base/escape.h"
#include "net/base/net_errors.h"
#include "storage/common/database/database_identifier.h"
Expand Down Expand Up @@ -324,15 +325,15 @@ std::string GetFileSystemTypeString(FileSystemType type) {
std::string FilePathToString(const base::FilePath& file_path) {
#if defined(OS_WIN)
return base::UTF16ToUTF8(file_path.value());
#elif defined(OS_POSIX)
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
return file_path.value();
#endif
}

base::FilePath StringToFilePath(const std::string& file_path_string) {
#if defined(OS_WIN)
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);
#endif
}
Expand Down

0 comments on commit fe8dfb3

Please sign in to comment.