OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/tools/test_shell/simple_database_system.h" | 5 #include "webkit/tools/test_shell/simple_database_system.h" |
6 | 6 |
7 #if defined(USE_SYSTEM_SQLITE) | 7 #if defined(USE_SYSTEM_SQLITE) |
8 #include <sqlite3.h> | 8 #include <sqlite3.h> |
9 #else | 9 #else |
10 #include "third_party/sqlite/preprocessed/sqlite3.h" | 10 #include "third_party/sqlite/preprocessed/sqlite3.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 AutoLock file_names_auto_lock(file_names_lock_); | 186 AutoLock file_names_auto_lock(file_names_lock_); |
187 file_names_[vfs_file_name] = file_name; | 187 file_names_[vfs_file_name] = file_name; |
188 file_names_[vfs_file_name + ASCIIToUTF16("-journal")] = | 188 file_names_[vfs_file_name + ASCIIToUTF16("-journal")] = |
189 FilePath::FromWStringHack(file_name.ToWStringHack() + | 189 FilePath::FromWStringHack(file_name.ToWStringHack() + |
190 ASCIIToWide("-journal")); | 190 ASCIIToWide("-journal")); |
191 } | 191 } |
192 | 192 |
193 FilePath SimpleDatabaseSystem::GetFullFilePathForVfsFile( | 193 FilePath SimpleDatabaseSystem::GetFullFilePathForVfsFile( |
194 const string16& vfs_file_name) { | 194 const string16& vfs_file_name) { |
| 195 if (vfs_file_name.empty()) // temp file, used for vacuuming |
| 196 return FilePath(); |
| 197 |
195 AutoLock file_names_auto_lock(file_names_lock_); | 198 AutoLock file_names_auto_lock(file_names_lock_); |
196 DCHECK(file_names_.find(vfs_file_name) != file_names_.end()); | 199 DCHECK(file_names_.find(vfs_file_name) != file_names_.end()); |
197 return file_names_[vfs_file_name]; | 200 return file_names_[vfs_file_name]; |
198 } | 201 } |
OLD | NEW |