Chromium Code Reviews| 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_MANAGER_H_ | 5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
| 6 #define STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 6 #define STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 // DeleteOriginData and DeleteHostData (surprisingly enough) delete data of a | 197 // DeleteOriginData and DeleteHostData (surprisingly enough) delete data of a |
| 198 // particular StorageType associated with either a specific origin or set of | 198 // particular StorageType associated with either a specific origin or set of |
| 199 // origins. Each method additionally requires a |quota_client_mask| which | 199 // origins. Each method additionally requires a |quota_client_mask| which |
| 200 // specifies the types of QuotaClients to delete from the origin. This is | 200 // specifies the types of QuotaClients to delete from the origin. This is |
| 201 // specified by the caller as a bitmask built from QuotaClient::IDs. Setting | 201 // specified by the caller as a bitmask built from QuotaClient::IDs. Setting |
| 202 // the mask to QuotaClient::kAllClientsMask will remove all clients from the | 202 // the mask to QuotaClient::kAllClientsMask will remove all clients from the |
| 203 // origin, regardless of type. | 203 // origin, regardless of type. |
| 204 virtual void DeleteOriginData(const GURL& origin, | 204 virtual void DeleteOriginData(const GURL& origin, |
| 205 StorageType type, | 205 StorageType type, |
| 206 int quota_client_mask, | 206 int quota_client_mask, |
| 207 bool is_eviction, | |
|
michaeln
2015/10/13 21:35:36
let's not change the public method sig to add this
calamity
2015/10/15 07:56:43
Done.
| |
| 207 const StatusCallback& callback); | 208 const StatusCallback& callback); |
| 208 void DeleteHostData(const std::string& host, | 209 void DeleteHostData(const std::string& host, |
| 209 StorageType type, | 210 StorageType type, |
| 210 int quota_client_mask, | 211 int quota_client_mask, |
| 211 const StatusCallback& callback); | 212 const StatusCallback& callback); |
| 212 | 213 |
| 213 // Called by UI and internal modules. | 214 // Called by UI and internal modules. |
| 214 void GetAvailableSpace(const AvailableSpaceCallback& callback); | 215 void GetAvailableSpace(const AvailableSpaceCallback& callback); |
| 215 void GetTemporaryGlobalQuota(const QuotaCallback& callback); | 216 void GetTemporaryGlobalQuota(const QuotaCallback& callback); |
| 216 | 217 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 static const int kPerHostTemporaryPortion; | 260 static const int kPerHostTemporaryPortion; |
| 260 | 261 |
| 261 static const int64 kPerHostPersistentQuotaLimit; | 262 static const int64 kPerHostPersistentQuotaLimit; |
| 262 | 263 |
| 263 static const char kDatabaseName[]; | 264 static const char kDatabaseName[]; |
| 264 | 265 |
| 265 static const int kThresholdOfErrorsToBeBlacklisted; | 266 static const int kThresholdOfErrorsToBeBlacklisted; |
| 266 | 267 |
| 267 static const int kEvictionIntervalInMilliSeconds; | 268 static const int kEvictionIntervalInMilliSeconds; |
| 268 | 269 |
| 270 static const char kTimeSinceOriginEvictedHistogram[]; | |
|
Ilya Sherman
2015/10/13 18:56:18
nit: The other histogram names are inlined, so it
calamity
2015/10/15 07:56:43
This is used in tests.
| |
| 271 | |
| 269 // These are kept non-const so that test code can change the value. | 272 // These are kept non-const so that test code can change the value. |
| 270 // TODO(kinuko): Make this a real const value and add a proper way to set | 273 // TODO(kinuko): Make this a real const value and add a proper way to set |
| 271 // the quota for syncable storage. (http://crbug.com/155488) | 274 // the quota for syncable storage. (http://crbug.com/155488) |
| 272 static int64 kMinimumPreserveForSystem; | 275 static int64 kMinimumPreserveForSystem; |
| 273 static int64 kSyncableStorageDefaultHostQuota; | 276 static int64 kSyncableStorageDefaultHostQuota; |
| 274 | 277 |
| 275 protected: | 278 protected: |
| 276 ~QuotaManager() override; | 279 ~QuotaManager() override; |
| 277 | 280 |
| 278 private: | 281 private: |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 const GURL& origin, | 359 const GURL& origin, |
| 357 StorageType type, | 360 StorageType type, |
| 358 int64 delta, | 361 int64 delta, |
| 359 base::Time modified_time); | 362 base::Time modified_time); |
| 360 | 363 |
| 361 void DumpQuotaTable(const DumpQuotaTableCallback& callback); | 364 void DumpQuotaTable(const DumpQuotaTableCallback& callback); |
| 362 void DumpOriginInfoTable(const DumpOriginInfoTableCallback& callback); | 365 void DumpOriginInfoTable(const DumpOriginInfoTableCallback& callback); |
| 363 | 366 |
| 364 // Methods for eviction logic. | 367 // Methods for eviction logic. |
| 365 void StartEviction(); | 368 void StartEviction(); |
| 366 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); | 369 void DeleteOriginFromDatabase(const GURL& origin, |
| 370 StorageType type, | |
| 371 bool is_eviction); | |
| 367 | 372 |
| 368 void DidOriginDataEvicted(QuotaStatusCode status); | 373 void DidOriginDataEvicted(QuotaStatusCode status); |
| 369 | 374 |
| 370 void ReportHistogram(); | 375 void ReportHistogram(); |
| 371 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, | 376 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, |
| 372 int64 unlimited_usage); | 377 int64 unlimited_usage); |
| 373 void DidGetPersistentGlobalUsageForHistogram(int64 usage, | 378 void DidGetPersistentGlobalUsageForHistogram(int64 usage, |
| 374 int64 unlimited_usage); | 379 int64 unlimited_usage); |
| 375 | 380 |
| 376 // QuotaEvictionHandler. | 381 // QuotaEvictionHandler. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 | 473 |
| 469 struct QuotaManagerDeleter { | 474 struct QuotaManagerDeleter { |
| 470 static void Destruct(const QuotaManager* manager) { | 475 static void Destruct(const QuotaManager* manager) { |
| 471 manager->DeleteOnCorrectThread(); | 476 manager->DeleteOnCorrectThread(); |
| 472 } | 477 } |
| 473 }; | 478 }; |
| 474 | 479 |
| 475 } // namespace storage | 480 } // namespace storage |
| 476 | 481 |
| 477 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 482 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
| OLD | NEW |