OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ | 5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ |
6 #define STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ | 6 #define STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 class MetaTable; | 27 class MetaTable; |
28 } | 28 } |
29 | 29 |
30 class GURL; | 30 class GURL; |
31 | 31 |
32 namespace storage { | 32 namespace storage { |
33 | 33 |
34 class SpecialStoragePolicy; | 34 class SpecialStoragePolicy; |
35 | 35 |
36 // All the methods of this class must run on the DB thread. | 36 // All the methods of this class must run on the DB thread. |
37 class STORAGE_EXPORT_PRIVATE QuotaDatabase { | 37 class STORAGE_EXPORT QuotaDatabase { |
38 public: | 38 public: |
39 struct STORAGE_EXPORT_PRIVATE OriginInfoTableEntry { | 39 struct STORAGE_EXPORT OriginInfoTableEntry { |
40 OriginInfoTableEntry(); | 40 OriginInfoTableEntry(); |
41 OriginInfoTableEntry(const GURL& origin, | 41 OriginInfoTableEntry(const GURL& origin, |
42 StorageType type, | 42 StorageType type, |
43 int used_count, | 43 int used_count, |
44 const base::Time& last_access_time, | 44 const base::Time& last_access_time, |
45 const base::Time& last_modified_time); | 45 const base::Time& last_modified_time); |
46 GURL origin; | 46 GURL origin; |
47 StorageType type; | 47 StorageType type; |
48 int used_count; | 48 int used_count; |
49 base::Time last_access_time; | 49 base::Time last_access_time; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 std::set<GURL>* origins, | 120 std::set<GURL>* origins, |
121 base::Time modified_since); | 121 base::Time modified_since); |
122 | 122 |
123 // Returns false if SetOriginDatabaseBootstrapped has never | 123 // Returns false if SetOriginDatabaseBootstrapped has never |
124 // been called before, which means existing origins may not have been | 124 // been called before, which means existing origins may not have been |
125 // registered. | 125 // registered. |
126 bool IsOriginDatabaseBootstrapped(); | 126 bool IsOriginDatabaseBootstrapped(); |
127 bool SetOriginDatabaseBootstrapped(bool bootstrap_flag); | 127 bool SetOriginDatabaseBootstrapped(bool bootstrap_flag); |
128 | 128 |
129 private: | 129 private: |
130 struct STORAGE_EXPORT_PRIVATE QuotaTableEntry { | 130 struct STORAGE_EXPORT QuotaTableEntry { |
131 QuotaTableEntry(); | 131 QuotaTableEntry(); |
132 QuotaTableEntry( | 132 QuotaTableEntry( |
133 const std::string& host, | 133 const std::string& host, |
134 StorageType type, | 134 StorageType type, |
135 int64 quota); | 135 int64 quota); |
136 std::string host; | 136 std::string host; |
137 StorageType type; | 137 StorageType type; |
138 int64 quota; | 138 int64 quota; |
139 }; | 139 }; |
140 friend STORAGE_EXPORT_PRIVATE bool operator <( | 140 friend STORAGE_EXPORT bool operator <( |
141 const QuotaTableEntry& lhs, const QuotaTableEntry& rhs); | 141 const QuotaTableEntry& lhs, const QuotaTableEntry& rhs); |
142 friend STORAGE_EXPORT_PRIVATE bool operator <( | 142 friend STORAGE_EXPORT bool operator <( |
143 const OriginInfoTableEntry& lhs, const OriginInfoTableEntry& rhs); | 143 const OriginInfoTableEntry& lhs, const OriginInfoTableEntry& rhs); |
144 | 144 |
145 // Structures used for CreateSchema. | 145 // Structures used for CreateSchema. |
146 struct TableSchema { | 146 struct TableSchema { |
147 const char* table_name; | 147 const char* table_name; |
148 const char* columns; | 148 const char* columns; |
149 }; | 149 }; |
150 struct IndexSchema { | 150 struct IndexSchema { |
151 const char* index_name; | 151 const char* index_name; |
152 const char* table_name; | 152 const char* table_name; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 static const TableSchema kTables[]; | 204 static const TableSchema kTables[]; |
205 static const IndexSchema kIndexes[]; | 205 static const IndexSchema kIndexes[]; |
206 | 206 |
207 DISALLOW_COPY_AND_ASSIGN(QuotaDatabase); | 207 DISALLOW_COPY_AND_ASSIGN(QuotaDatabase); |
208 }; | 208 }; |
209 | 209 |
210 } // namespace storage | 210 } // namespace storage |
211 | 211 |
212 #endif // STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ | 212 #endif // STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ |
OLD | NEW |