| Index: webkit/quota/quota_database.h
|
| ===================================================================
|
| --- webkit/quota/quota_database.h (revision 91690)
|
| +++ webkit/quota/quota_database.h (working copy)
|
| @@ -41,24 +41,19 @@
|
|
|
| bool GetHostQuota(const std::string& host, StorageType type, int64* quota);
|
| bool SetHostQuota(const std::string& host, StorageType type, int64 quota);
|
| - bool DeleteHostQuota(const std::string& host, StorageType type);
|
|
|
| - bool SetOriginLastAccessTime(const GURL& origin,
|
| - StorageType type,
|
| + bool SetOriginLastAccessTime(const GURL& origin, StorageType type,
|
| base::Time last_access_time);
|
|
|
| - bool SetOriginLastModifiedTime(const GURL& origin,
|
| - StorageType type,
|
| - base::Time last_modified_time);
|
| + // Register |origins| to Database with |used_count| = 0 and
|
| + // specified |last_access_time|.
|
| + bool RegisterOrigins(const std::set<GURL>& origins,
|
| + StorageType type,
|
| + base::Time last_access_time);
|
|
|
| - // Register initial |origins| info |type| to the database.
|
| - // This method is assumed to be called only after the installation or
|
| - // the database schema reset.
|
| - bool RegisterInitialOriginInfo(
|
| - const std::set<GURL>& origins, StorageType type);
|
| + bool DeleteHostQuota(const std::string& host, StorageType type);
|
| + bool DeleteOriginLastAccessTime(const GURL& origin, StorageType type);
|
|
|
| - bool DeleteOriginInfo(const GURL& origin, StorageType type);
|
| -
|
| bool GetGlobalQuota(StorageType type, int64* quota);
|
| bool SetGlobalQuota(StorageType type, int64 quota);
|
|
|
| @@ -71,12 +66,6 @@
|
| SpecialStoragePolicy* special_storage_policy,
|
| GURL* origin);
|
|
|
| - // Populates |origins| with the ones that have been modified since
|
| - // the |modified_since|.
|
| - bool GetOriginsModifiedSince(StorageType type,
|
| - std::set<GURL>* origins,
|
| - base::Time modified_since);
|
| -
|
| // Returns false if SetOriginDatabaseBootstrapped has never
|
| // been called before, which means existing origins may not have been
|
| // registered.
|
| @@ -92,34 +81,19 @@
|
| friend bool operator <(const QuotaTableEntry& lhs,
|
| const QuotaTableEntry& rhs);
|
|
|
| - struct OriginInfoTableEntry {
|
| + struct LastAccessTimeTableEntry {
|
| GURL origin;
|
| StorageType type;
|
| int used_count;
|
| base::Time last_access_time;
|
| - base::Time last_modified_time;
|
| };
|
| - friend bool operator <(const OriginInfoTableEntry& lhs,
|
| - const OriginInfoTableEntry& rhs);
|
| + friend bool operator <(const LastAccessTimeTableEntry& lhs,
|
| + const LastAccessTimeTableEntry& rhs);
|
|
|
| - // Structures used for CreateSchema.
|
| - struct TableSchema {
|
| - const char* table_name;
|
| - const char* columns;
|
| - };
|
| - struct IndexSchema {
|
| - const char* index_name;
|
| - const char* table_name;
|
| - const char* columns;
|
| - bool unique;
|
| - };
|
| -
|
| typedef base::Callback<bool (const QuotaTableEntry&)> QuotaTableCallback;
|
| - typedef base::Callback<bool (const OriginInfoTableEntry&)>
|
| - OriginInfoTableCallback;
|
| + typedef base::Callback<bool (const LastAccessTimeTableEntry&)>
|
| + LastAccessTimeTableCallback;
|
|
|
| - struct QuotaTableImporter;
|
| -
|
| // For long-running transactions support. We always keep a transaction open
|
| // so that multiple transactions can be batched. They are flushed
|
| // with a delay after a modification has been made. We support neither
|
| @@ -133,20 +107,14 @@
|
|
|
| bool LazyOpen(bool create_if_needed);
|
| bool EnsureDatabaseVersion();
|
| + bool CreateSchema();
|
| bool ResetSchema();
|
| - bool UpgradeSchema(int current_version);
|
|
|
| - static bool CreateSchema(
|
| - sql::Connection* database,
|
| - sql::MetaTable* meta_table,
|
| - int schema_version, int compatible_version,
|
| - const TableSchema* tables, size_t tables_size,
|
| - const IndexSchema* indexes, size_t indexes_size);
|
| -
|
| - // |callback| may return false to stop reading data.
|
| + // |callback| may return false to stop reading data
|
| bool DumpQuotaTable(QuotaTableCallback* callback);
|
| - bool DumpOriginInfoTable(OriginInfoTableCallback* callback);
|
| + bool DumpLastAccessTimeTable(LastAccessTimeTableCallback* callback);
|
|
|
| +
|
| FilePath db_file_path_;
|
|
|
| scoped_ptr<sql::Connection> db_;
|
| @@ -159,9 +127,6 @@
|
| friend class QuotaDatabaseTest;
|
| friend class QuotaManager;
|
|
|
| - static const TableSchema kTables[];
|
| - static const IndexSchema kIndexes[];
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(QuotaDatabase);
|
| };
|
|
|
|
|