Chromium Code Reviews| Index: webkit/quota/quota_database.h |
| diff --git a/webkit/quota/quota_database.h b/webkit/quota/quota_database.h |
| index 981bb94a1bc575443a25a59a04b8cb212815f4bb..1a8c6b5ac79cec4c8c333ea3ed79ab4e2a07c736 100644 |
| --- a/webkit/quota/quota_database.h |
| +++ b/webkit/quota/quota_database.h |
| @@ -42,17 +42,23 @@ class QuotaDatabase { |
| bool GetHostQuota(const std::string& host, StorageType type, int64* quota); |
| bool SetHostQuota(const std::string& host, StorageType type, int64 quota); |
| - 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|. |
| + // specified |last_access_time|. Last modified time for the |
| + // registered origin will be initialized to 0. |
|
Mike West
2011/06/16 09:39:33
Isn't the origin being modified at `base::Time::No
kinuko
2011/06/16 12:09:06
The naming might be confusing here, this is a one-
|
| bool RegisterOrigins(const std::set<GURL>& origins, |
| StorageType type, |
| base::Time last_access_time); |
| bool DeleteHostQuota(const std::string& host, StorageType type); |
|
Mike West
2011/06/16 09:39:33
Maybe move this up to live with `GetHostQuota` and
kinuko
2011/06/16 12:09:06
Done.
|
| - 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); |
| @@ -66,6 +72,12 @@ class QuotaDatabase { |
| 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. |
| @@ -81,18 +93,19 @@ class QuotaDatabase { |
| friend bool operator <(const QuotaTableEntry& lhs, |
| const QuotaTableEntry& rhs); |
| - struct LastAccessTimeTableEntry { |
| + struct OriginInfoTableEntry { |
| GURL origin; |
| StorageType type; |
| int used_count; |
| base::Time last_access_time; |
| + base::Time last_modified_time; |
| }; |
| - friend bool operator <(const LastAccessTimeTableEntry& lhs, |
| - const LastAccessTimeTableEntry& rhs); |
| + friend bool operator <(const OriginInfoTableEntry& lhs, |
| + const OriginInfoTableEntry& rhs); |
| typedef base::Callback<bool (const QuotaTableEntry&)> QuotaTableCallback; |
| - typedef base::Callback<bool (const LastAccessTimeTableEntry&)> |
| - LastAccessTimeTableCallback; |
| + typedef base::Callback<bool (const OriginInfoTableEntry&)> |
| + OriginInfoTableCallback; |
| // For long-running transactions support. We always keep a transaction open |
| // so that multiple transactions can be batched. They are flushed |
| @@ -110,10 +123,9 @@ class QuotaDatabase { |
| bool CreateSchema(); |
| bool ResetSchema(); |
| - // |callback| may return false to stop reading data |
| + // |callback| may return false to stop reading data. |
| bool DumpQuotaTable(QuotaTableCallback* callback); |
| - bool DumpLastAccessTimeTable(LastAccessTimeTableCallback* callback); |
| - |
| + bool DumpOriginInfoTable(OriginInfoTableCallback* callback); |
| FilePath db_file_path_; |