diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-14 05:09:03 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-14 05:09:03 +0000 |
commit | 128cef2643ccd6816efd2dcca798e9f0b38705a9 (patch) | |
tree | 21767508fef64b020f3abd2f66a70e9ef92b8488 /webkit/tools/test_shell/simple_database_system.h | |
parent | 6eb9703c0f016b7636bf366888fb76b885ad9f1e (diff) | |
download | chromium_src-128cef2643ccd6816efd2dcca798e9f0b38705a9.zip chromium_src-128cef2643ccd6816efd2dcca798e9f0b38705a9.tar.gz chromium_src-128cef2643ccd6816efd2dcca798e9f0b38705a9.tar.bz2 |
Enables most DB layout tests in test_shell.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/384118
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/simple_database_system.h')
-rw-r--r-- | webkit/tools/test_shell/simple_database_system.h | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/webkit/tools/test_shell/simple_database_system.h b/webkit/tools/test_shell/simple_database_system.h index cf8c997..f741b97 100644 --- a/webkit/tools/test_shell/simple_database_system.h +++ b/webkit/tools/test_shell/simple_database_system.h @@ -5,34 +5,57 @@ #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/platform_file.h" +#include "base/ref_counted.h" #include "base/scoped_temp_dir.h" +#include "base/string16.h" +#include "third_party/WebKit/WebKit/chromium/public/WebDatabaseObserver.h" +#include "webkit/database/database_tracker.h" -class SimpleDatabaseSystem { +class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer, + public WebKit::WebDatabaseObserver { public: static SimpleDatabaseSystem* GetInstance(); SimpleDatabaseSystem(); ~SimpleDatabaseSystem(); - base::PlatformFile OpenFile( - const FilePath& file_name, int desired_flags, - base::PlatformFile* dir_handle); - int DeleteFile(const FilePath& file_name, bool sync_dir); - long GetFileAttributes(const FilePath& file_name); - long long GetFileSize(const FilePath& file_name); + // VFS functions + base::PlatformFile OpenFile(const string16& vfs_file_name, + int desired_flags, + base::PlatformFile* dir_handle); + 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); + + // database tracker functions + void DatabaseOpened(const string16& origin_identifier, + const string16& database_name, + const string16& description, + int64 estimated_size); + void DatabaseModified(const string16& origin_identifier, + const string16& database_name); + void DatabaseClosed(const string16& origin_identifier, + const string16& database_name); + + // DatabaseTracker::Observer implementation + virtual void OnDatabaseSizeChanged(const string16& origin_identifier, + const string16& database_name, + int64 database_size, + int64 space_available); + + // WebDatabaseObserver implementation + virtual void databaseOpened(const WebKit::WebDatabase& database); + virtual void databaseModified(const WebKit::WebDatabase& database); + virtual void databaseClosed(const WebKit::WebDatabase& database); + void ClearAllDatabases(); private: - FilePath GetDBDir(); - FilePath GetDBFileFullPath(const FilePath& file_name); - static SimpleDatabaseSystem* instance_; ScopedTempDir temp_dir_; - // HACK: see OpenFile's implementation - base::PlatformFile hack_main_db_handle_; + scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; }; #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_DATABASE_SYSTEM_H_ |