From beaafbaf7a599c92912702bc2b5b3e770849a74a Mon Sep 17 00:00:00 2001 From: "dumi@chromium.org" Date: Wed, 12 May 2010 03:27:39 +0000 Subject: Remove the dirfd parameter from all Chromium code. The POSIX VFS doesn't need it. BUG=43489 TEST=none Review URL: http://codereview.chromium.org/2055009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47006 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/database/vfs_backend.cc | 25 +++---------------------- webkit/database/vfs_backend.h | 6 ++---- 2 files changed, 5 insertions(+), 26 deletions(-) (limited to 'webkit/database') diff --git a/webkit/database/vfs_backend.cc b/webkit/database/vfs_backend.cc index 8cb8e05..0d9cb4f 100644 --- a/webkit/database/vfs_backend.cc +++ b/webkit/database/vfs_backend.cc @@ -71,8 +71,7 @@ bool VfsBackend::OpenFileFlagsAreConsistent(int desired_flags) { void VfsBackend::OpenFile(const FilePath& file_path, int desired_flags, base::ProcessHandle handle, - base::PlatformFile* target_handle, - base::PlatformFile* target_dir_handle) { + base::PlatformFile* target_handle) { DCHECK(!file_path.empty()); // Verify the flags for consistency and create the database @@ -118,22 +117,6 @@ void VfsBackend::OpenFile(const FilePath& file_path, } #elif defined(OS_POSIX) *target_handle = file_handle; - - int file_type = desired_flags & 0x00007F00; - bool creating_new_file = (desired_flags & SQLITE_OPEN_CREATE); - if (creating_new_file && ((file_type == SQLITE_OPEN_MASTER_JOURNAL) || - (file_type == SQLITE_OPEN_MAIN_JOURNAL))) { - // We return a handle to the containing directory because on POSIX - // systems the VFS might want to fsync it after changing a file. - // By returning it here, we avoid an extra IPC call. - *target_dir_handle = base::CreatePlatformFile( - file_path.DirName().ToWStringHack(), - base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, NULL); - if (*target_dir_handle == base::kInvalidPlatformFileValue) { - base::ClosePlatformFile(*target_handle); - *target_handle = base::kInvalidPlatformFileValue; - } - } #endif } } @@ -143,8 +126,7 @@ void VfsBackend::OpenTempFileInDirectory( const FilePath& dir_path, int desired_flags, base::ProcessHandle handle, - base::PlatformFile* target_handle, - base::PlatformFile* target_dir_handle) { + base::PlatformFile* target_handle) { // We should be able to delete temp files when they're closed // and create them as needed if (!(desired_flags & SQLITE_OPEN_DELETEONCLOSE) || @@ -157,8 +139,7 @@ void VfsBackend::OpenTempFileInDirectory( if (!file_util::CreateTemporaryFileInDir(dir_path, &temp_file_path)) return; - OpenFile(temp_file_path, desired_flags, handle, - target_handle, target_dir_handle); + OpenFile(temp_file_path, desired_flags, handle, target_handle); } // static diff --git a/webkit/database/vfs_backend.h b/webkit/database/vfs_backend.h index 97ce7e0..267ce90 100644 --- a/webkit/database/vfs_backend.h +++ b/webkit/database/vfs_backend.h @@ -18,14 +18,12 @@ class VfsBackend { static void OpenFile(const FilePath& file_path, int desired_flags, base::ProcessHandle handle, - base::PlatformFile* target_handle, - base::PlatformFile* target_dir_handle); + base::PlatformFile* target_handle); static void OpenTempFileInDirectory(const FilePath& dir_path, int desired_flags, base::ProcessHandle handle, - base::PlatformFile* target_handle, - base::PlatformFile* target_dir_handle); + base::PlatformFile* target_handle); static int DeleteFile(const FilePath& file_path, bool sync_dir); -- cgit v1.1