summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/simple_database_system.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools/test_shell/simple_database_system.cc')
-rw-r--r--webkit/tools/test_shell/simple_database_system.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/webkit/tools/test_shell/simple_database_system.cc b/webkit/tools/test_shell/simple_database_system.cc
index ab98e1a..dd0d032 100644
--- a/webkit/tools/test_shell/simple_database_system.cc
+++ b/webkit/tools/test_shell/simple_database_system.cc
@@ -41,9 +41,15 @@ base::PlatformFile SimpleDatabaseSystem::OpenFile(
const FilePath& file_name, int desired_flags,
base::PlatformFile* dir_handle) {
base::PlatformFile file_handle = base::kInvalidPlatformFileValue;
- VfsBackend::OpenFile(GetDBFileFullPath(file_name), GetDBDir(), desired_flags,
- base::GetCurrentProcessHandle(), &file_handle,
- dir_handle);
+ if (file_name.empty()) {
+ VfsBackend::OpenTempFileInDirectory(
+ GetDBDir(), desired_flags, base::GetCurrentProcessHandle(),
+ &file_handle, dir_handle);
+ } else {
+ VfsBackend::OpenFile(GetDBFileFullPath(file_name), desired_flags,
+ base::GetCurrentProcessHandle(), &file_handle,
+ dir_handle);
+ }
// HACK: Currently, the DB object that keeps track of the main database
// (DatabaseTracker) is a singleton that is declared as a static variable
@@ -75,7 +81,7 @@ int SimpleDatabaseSystem::DeleteFile(
int error_code = SQLITE_OK;
do {
error_code = VfsBackend::DeleteFile(
- GetDBFileFullPath(file_name), GetDBDir(), sync_dir);
+ GetDBFileFullPath(file_name), sync_dir);
} while ((++num_retries < kNumDeleteRetries) &&
(error_code == SQLITE_IOERR_DELETE) &&
(PlatformThread::Sleep(10), 1));