| Index: webkit/tools/test_shell/simple_database_system.h
|
| ===================================================================
|
| --- webkit/tools/test_shell/simple_database_system.h (revision 31991)
|
| +++ webkit/tools/test_shell/simple_database_system.h (working copy)
|
| @@ -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_
|
|
|