OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_DATABASE_DATABASE_TRACKER_H_ | 5 #ifndef WEBKIT_DATABASE_DATABASE_TRACKER_H_ |
6 #define WEBKIT_DATABASE_DATABASE_TRACKER_H_ | 6 #define WEBKIT_DATABASE_DATABASE_TRACKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void CloseTrackerDatabaseAndClearCaches(); | 119 void CloseTrackerDatabaseAndClearCaches(); |
120 | 120 |
121 const FilePath& DatabaseDirectory() const { return db_dir_; } | 121 const FilePath& DatabaseDirectory() const { return db_dir_; } |
122 FilePath GetFullDBFilePath(const string16& origin_identifier, | 122 FilePath GetFullDBFilePath(const string16& origin_identifier, |
123 const string16& database_name) const; | 123 const string16& database_name) const; |
124 | 124 |
125 bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); | 125 bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); |
126 void SetOriginQuota(const string16& origin_identifier, int64 new_quota); | 126 void SetOriginQuota(const string16& origin_identifier, int64 new_quota); |
127 void SetOriginQuotaInMemory(const string16& origin_identifier, | 127 void SetOriginQuotaInMemory(const string16& origin_identifier, |
128 int64 new_quota); | 128 int64 new_quota); |
| 129 void ResetOriginQuotaInMemory(const string16& origin_identifier); |
129 | 130 |
130 int64 GetDefaultQuota() { return default_quota_; } | 131 int64 GetDefaultQuota() { return default_quota_; } |
131 // Sets the default quota for all origins. Should be used in tests only. | 132 // Sets the default quota for all origins. Should be used in tests only. |
132 void SetDefaultQuota(int64 quota); | 133 void SetDefaultQuota(int64 quota); |
133 | 134 |
134 bool IsDatabaseScheduledForDeletion(const string16& origin_identifier, | 135 bool IsDatabaseScheduledForDeletion(const string16& origin_identifier, |
135 const string16& database_name); | 136 const string16& database_name); |
136 | 137 |
137 // Deletes a single database. Returns net::OK on success, net::FAILED on | 138 // Deletes a single database. Returns net::OK on success, net::FAILED on |
138 // failure, or net::ERR_IO_PENDING and |callback| is invoked upon completion, | 139 // failure, or net::ERR_IO_PENDING and |callback| is invoked upon completion, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // Store quotas for extensions in memory, in order to prevent writing a row | 233 // Store quotas for extensions in memory, in order to prevent writing a row |
233 // to quota_table_ every time an extention is loaded. | 234 // to quota_table_ every time an extention is loaded. |
234 std::map<string16, int64> in_memory_quotas_; | 235 std::map<string16, int64> in_memory_quotas_; |
235 | 236 |
236 FRIEND_TEST(DatabaseTrackerTest, TestIt); | 237 FRIEND_TEST(DatabaseTrackerTest, TestIt); |
237 }; | 238 }; |
238 | 239 |
239 } // namespace webkit_database | 240 } // namespace webkit_database |
240 | 241 |
241 #endif // WEBKIT_DATABASE_DATABASE_TRACKER_H_ | 242 #endif // WEBKIT_DATABASE_DATABASE_TRACKER_H_ |
OLD | NEW |