diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 03:27:39 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 03:27:39 +0000 |
commit | beaafbaf7a599c92912702bc2b5b3e770849a74a (patch) | |
tree | 06a9d047770783c16e9cbffe374c3335d3dd9e6b /webkit | |
parent | aa5ff891c563531aa38fbee52c36f29c66ca3e54 (diff) | |
download | chromium_src-beaafbaf7a599c92912702bc2b5b3e770849a74a.zip chromium_src-beaafbaf7a599c92912702bc2b5b3e770849a74a.tar.gz chromium_src-beaafbaf7a599c92912702bc2b5b3e770849a74a.tar.bz2 |
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
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/database/vfs_backend.cc | 25 | ||||
-rw-r--r-- | webkit/database/vfs_backend.h | 6 | ||||
-rw-r--r-- | webkit/glue/webkitclient_impl.cc | 7 | ||||
-rw-r--r-- | webkit/glue/webkitclient_impl.h | 6 | ||||
-rw-r--r-- | webkit/support/test_webkit_client.cc | 5 | ||||
-rw-r--r-- | webkit/support/test_webkit_client.h | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_database_system.cc | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_database_system.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_webkit_init.h | 5 |
9 files changed, 27 insertions, 42 deletions
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); diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc index a065ad8..29b812a 100644 --- a/webkit/glue/webkitclient_impl.cc +++ b/webkit/glue/webkitclient_impl.cc @@ -333,11 +333,18 @@ void WebKitClientImpl::callOnMainThread(void (*func)(void*), void* context) { main_loop_->PostTask(FROM_HERE, NewRunnableFunction(func, context)); } +// TODO: remove this method once https://bugs.webkit.org/show_bug.cgi?id=38869 +// is resolved. base::PlatformFile WebKitClientImpl::databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags, base::PlatformFile* dir_handle) { if (dir_handle) *dir_handle = base::kInvalidPlatformFileValue; + return databaseOpenFile(vfs_file_name, desired_flags); +} + +base::PlatformFile WebKitClientImpl::databaseOpenFile( + const WebKit::WebString& vfs_file_name, int desired_flags) { return base::kInvalidPlatformFileValue; } diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h index 6b8e345..0f70841 100644 --- a/webkit/glue/webkitclient_impl.h +++ b/webkit/glue/webkitclient_impl.h @@ -23,10 +23,16 @@ class WebKitClientImpl : public WebKit::WebKitClient { // WebKitClient methods (partial implementation): virtual WebKit::WebThemeEngine* themeEngine(); + + // TODO: remove this method once https://bugs.webkit.org/show_bug.cgi?id=38869 + // is resolved. virtual base::PlatformFile databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags, base::PlatformFile* dir_handle); + + virtual base::PlatformFile databaseOpenFile( + const WebKit::WebString& vfs_file_name, int desired_flags); virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir); virtual long databaseGetFileAttributes( diff --git a/webkit/support/test_webkit_client.cc b/webkit/support/test_webkit_client.cc index 749fa80..874717c 100644 --- a/webkit/support/test_webkit_client.cc +++ b/webkit/support/test_webkit_client.cc @@ -156,10 +156,9 @@ bool TestWebKitClient::sandboxEnabled() { } WebKit::WebKitClient::FileHandle TestWebKitClient::databaseOpenFile( - const WebKit::WebString& vfs_file_name, int desired_flags, - WebKit::WebKitClient::FileHandle* dir_handle) { + const WebKit::WebString& vfs_file_name, int desired_flags) { return SimpleDatabaseSystem::GetInstance()->OpenFile( - vfs_file_name, desired_flags, dir_handle); + vfs_file_name, desired_flags); } int TestWebKitClient::databaseDeleteFile(const WebKit::WebString& vfs_file_name, diff --git a/webkit/support/test_webkit_client.h b/webkit/support/test_webkit_client.h index c0c8a6a..3e106a9 100644 --- a/webkit/support/test_webkit_client.h +++ b/webkit/support/test_webkit_client.h @@ -26,8 +26,7 @@ class TestWebKitClient : public webkit_glue::WebKitClientImpl { virtual WebKit::WebCookieJar* cookieJar(); virtual bool sandboxEnabled(); virtual WebKit::WebKitClient::FileHandle databaseOpenFile( - const WebKit::WebString& vfs_file_name, int desired_flags, - WebKit::WebKitClient::FileHandle* dir_handle); + const WebKit::WebString& vfs_file_name, int desired_flags); virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir); virtual long databaseGetFileAttributes( diff --git a/webkit/tools/test_shell/simple_database_system.cc b/webkit/tools/test_shell/simple_database_system.cc index fbb4cac..8f87dc2 100644 --- a/webkit/tools/test_shell/simple_database_system.cc +++ b/webkit/tools/test_shell/simple_database_system.cc @@ -46,18 +46,16 @@ SimpleDatabaseSystem::~SimpleDatabaseSystem() { } base::PlatformFile SimpleDatabaseSystem::OpenFile( - const string16& vfs_file_name, int desired_flags, - base::PlatformFile* dir_handle) { + const string16& vfs_file_name, int desired_flags) { base::PlatformFile file_handle = base::kInvalidPlatformFileValue; FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name); if (file_name.empty()) { VfsBackend::OpenTempFileInDirectory( db_tracker_->DatabaseDirectory(), desired_flags, - base::GetCurrentProcessHandle(), &file_handle, dir_handle); + base::GetCurrentProcessHandle(), &file_handle); } else { VfsBackend::OpenFile(file_name, desired_flags, - base::GetCurrentProcessHandle(), &file_handle, - dir_handle); + base::GetCurrentProcessHandle(), &file_handle); } return file_handle; diff --git a/webkit/tools/test_shell/simple_database_system.h b/webkit/tools/test_shell/simple_database_system.h index 8441d31..6ec1be6 100644 --- a/webkit/tools/test_shell/simple_database_system.h +++ b/webkit/tools/test_shell/simple_database_system.h @@ -24,9 +24,7 @@ class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer, ~SimpleDatabaseSystem(); // VFS functions - base::PlatformFile OpenFile(const string16& vfs_file_name, - int desired_flags, - base::PlatformFile* dir_handle); + base::PlatformFile OpenFile(const string16& vfs_file_name, int desired_flags); int DeleteFile(const string16& vfs_file_name, bool sync_dir); long GetFileAttributes(const string16& vfs_file_name); long long GetFileSize(const string16& vfs_file_name); diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h index c4e79b4..9158f16 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.h +++ b/webkit/tools/test_shell/test_shell_webkit_init.h @@ -134,10 +134,9 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { } virtual WebKit::WebKitClient::FileHandle databaseOpenFile( - const WebKit::WebString& vfs_file_name, int desired_flags, - WebKit::WebKitClient::FileHandle* dir_handle) { + const WebKit::WebString& vfs_file_name, int desired_flags) { return SimpleDatabaseSystem::GetInstance()->OpenFile( - vfs_file_name, desired_flags, dir_handle); + vfs_file_name, desired_flags); } virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, |