summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/database/database_util.cc5
-rw-r--r--webkit/support/simple_database_system.cc4
2 files changed, 5 insertions, 4 deletions
diff --git a/webkit/database/database_util.cc b/webkit/database/database_util.cc
index 2886095..85a1143 100644
--- a/webkit/database/database_util.cc
+++ b/webkit/database/database_util.cc
@@ -56,8 +56,9 @@ FilePath DatabaseUtil::GetFullFilePathForVfsFile(
FilePath full_path = db_tracker->GetFullDBFilePath(
origin_identifier, database_name);
if (!full_path.empty() && !sqlite_suffix.empty()) {
- full_path = FilePath::FromWStringHack(
- full_path.ToWStringHack() + UTF16ToWide(sqlite_suffix));
+ DCHECK(full_path.Extension().empty());
+ full_path = full_path.InsertBeforeExtensionASCII(
+ UTF16ToASCII(sqlite_suffix));
}
// Watch out for directory traversal attempts from a compromised renderer.
if (full_path.value().find(FILE_PATH_LITERAL("..")) !=
diff --git a/webkit/support/simple_database_system.cc b/webkit/support/simple_database_system.cc
index c1749a5..6c00d6c 100644
--- a/webkit/support/simple_database_system.cc
+++ b/webkit/support/simple_database_system.cc
@@ -177,9 +177,9 @@ void SimpleDatabaseSystem::SetFullFilePathsForVfsFile(
base::AutoLock file_names_auto_lock(file_names_lock_);
file_names_[vfs_file_name] = file_name;
+ DCHECK(file_name.Extension().empty());
file_names_[vfs_file_name + ASCIIToUTF16("-journal")] =
- FilePath::FromWStringHack(file_name.ToWStringHack() +
- ASCIIToWide("-journal"));
+ file_name.InsertBeforeExtensionASCII("-journal");
}
FilePath SimpleDatabaseSystem::GetFullFilePathForVfsFile(