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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void ScheduleCommit(); | 155 void ScheduleCommit(); |
156 | 156 |
157 bool FindOriginUsedCount(const GURL& origin, | 157 bool FindOriginUsedCount(const GURL& origin, |
158 StorageType type, | 158 StorageType type, |
159 int* used_count); | 159 int* used_count); |
160 | 160 |
161 bool LazyOpen(bool create_if_needed); | 161 bool LazyOpen(bool create_if_needed); |
162 bool EnsureDatabaseVersion(); | 162 bool EnsureDatabaseVersion(); |
163 bool ResetSchema(); | 163 bool ResetSchema(); |
164 bool UpgradeSchema(int current_version); | 164 bool UpgradeSchema(int current_version); |
| 165 bool InsertOrReplaceHostQuota( |
| 166 const std::string& host, StorageType type, int64 quota); |
165 | 167 |
166 static bool CreateSchema( | 168 static bool CreateSchema( |
167 sql::Connection* database, | 169 sql::Connection* database, |
168 sql::MetaTable* meta_table, | 170 sql::MetaTable* meta_table, |
169 int schema_version, int compatible_version, | 171 int schema_version, int compatible_version, |
170 const TableSchema* tables, size_t tables_size, | 172 const TableSchema* tables, size_t tables_size, |
171 const IndexSchema* indexes, size_t indexes_size); | 173 const IndexSchema* indexes, size_t indexes_size); |
172 | 174 |
173 // |callback| may return false to stop reading data. | 175 // |callback| may return false to stop reading data. |
174 bool DumpQuotaTable(const QuotaTableCallback& callback); | 176 bool DumpQuotaTable(const QuotaTableCallback& callback); |
(...skipping 13 matching lines...) Expand all Loading... |
188 | 190 |
189 static const TableSchema kTables[]; | 191 static const TableSchema kTables[]; |
190 static const IndexSchema kIndexes[]; | 192 static const IndexSchema kIndexes[]; |
191 | 193 |
192 DISALLOW_COPY_AND_ASSIGN(QuotaDatabase); | 194 DISALLOW_COPY_AND_ASSIGN(QuotaDatabase); |
193 }; | 195 }; |
194 | 196 |
195 } // namespace storage | 197 } // namespace storage |
196 | 198 |
197 #endif // STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ | 199 #endif // STORAGE_BROWSER_QUOTA_QUOTA_DATABASE_H_ |
OLD | NEW |