Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: webkit/tools/test_shell/simple_database_system.h

Issue 404013: Fixes a crash source in test_shell when running DB tests.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/tools/test_shell/simple_database_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_database_system.h
===================================================================
--- webkit/tools/test_shell/simple_database_system.h (revision 32068)
+++ webkit/tools/test_shell/simple_database_system.h (working copy)
@@ -5,6 +5,9 @@
#ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_
#define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_
+#include "base/file_path.h"
+#include "base/hash_tables.h"
+#include "base/lock.h"
#include "base/platform_file.h"
#include "base/ref_counted.h"
#include "base/scoped_temp_dir.h"
@@ -51,11 +54,25 @@
void ClearAllDatabases();
private:
+ // The calls that come from the database tracker run on the main thread.
+ // Therefore, we can only call DatabaseUtil::GetFullFilePathForVfsFile()
+ // on the main thread. However, the VFS calls run on the DB thread and
+ // they need to crack VFS file paths. To resolve this problem, we store
+ // a map of vfs_file_names to file_paths. The map is updated on the main
+ // thread on each DatabaseOpened() call that comes from the database
+ // tracker, and is read on the DB thread by each VFS call.
+ void SetFullFilePathsForVfsFile(const string16& origin_identifier,
+ const string16& database_name);
+ FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name);
+
static SimpleDatabaseSystem* instance_;
ScopedTempDir temp_dir_;
scoped_refptr<webkit_database::DatabaseTracker> db_tracker_;
+
+ Lock file_names_lock_;
+ base::hash_map<string16, FilePath> file_names_;
};
#endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_
« no previous file with comments | « no previous file | webkit/tools/test_shell/simple_database_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698