| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 static const int kPerHostTemporaryPortion; | 259 static const int kPerHostTemporaryPortion; |
| 260 | 260 |
| 261 static const int64 kPerHostPersistentQuotaLimit; | 261 static const int64 kPerHostPersistentQuotaLimit; |
| 262 | 262 |
| 263 static const char kDatabaseName[]; | 263 static const char kDatabaseName[]; |
| 264 | 264 |
| 265 static const int kThresholdOfErrorsToBeBlacklisted; | 265 static const int kThresholdOfErrorsToBeBlacklisted; |
| 266 | 266 |
| 267 static const int kEvictionIntervalInMilliSeconds; | 267 static const int kEvictionIntervalInMilliSeconds; |
| 268 | 268 |
| 269 static const char kTimeBetweenOriginEvictionsHistogram[]; |
| 270 |
| 269 // These are kept non-const so that test code can change the value. | 271 // 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 | 272 // 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) | 273 // the quota for syncable storage. (http://crbug.com/155488) |
| 272 static int64 kMinimumPreserveForSystem; | 274 static int64 kMinimumPreserveForSystem; |
| 273 static int64 kSyncableStorageDefaultHostQuota; | 275 static int64 kSyncableStorageDefaultHostQuota; |
| 274 | 276 |
| 275 protected: | 277 protected: |
| 276 ~QuotaManager() override; | 278 ~QuotaManager() override; |
| 277 | 279 |
| 278 private: | 280 private: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 void NotifyStorageModifiedInternal( | 356 void NotifyStorageModifiedInternal( |
| 355 QuotaClient::ID client_id, | 357 QuotaClient::ID client_id, |
| 356 const GURL& origin, | 358 const GURL& origin, |
| 357 StorageType type, | 359 StorageType type, |
| 358 int64 delta, | 360 int64 delta, |
| 359 base::Time modified_time); | 361 base::Time modified_time); |
| 360 | 362 |
| 361 void DumpQuotaTable(const DumpQuotaTableCallback& callback); | 363 void DumpQuotaTable(const DumpQuotaTableCallback& callback); |
| 362 void DumpOriginInfoTable(const DumpOriginInfoTableCallback& callback); | 364 void DumpOriginInfoTable(const DumpOriginInfoTableCallback& callback); |
| 363 | 365 |
| 366 void DeleteOriginDataInternal(const GURL& origin, |
| 367 StorageType type, |
| 368 int quota_client_mask, |
| 369 bool is_eviction, |
| 370 const StatusCallback& callback); |
| 371 |
| 364 // Methods for eviction logic. | 372 // Methods for eviction logic. |
| 365 void StartEviction(); | 373 void StartEviction(); |
| 366 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); | 374 void DeleteOriginFromDatabase(const GURL& origin, |
| 375 StorageType type, |
| 376 bool is_eviction); |
| 367 | 377 |
| 368 void DidOriginDataEvicted(QuotaStatusCode status); | 378 void DidOriginDataEvicted(QuotaStatusCode status); |
| 369 | 379 |
| 370 void ReportHistogram(); | 380 void ReportHistogram(); |
| 371 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, | 381 void DidGetTemporaryGlobalUsageForHistogram(int64 usage, |
| 372 int64 unlimited_usage); | 382 int64 unlimited_usage); |
| 373 void DidGetPersistentGlobalUsageForHistogram(int64 usage, | 383 void DidGetPersistentGlobalUsageForHistogram(int64 usage, |
| 374 int64 unlimited_usage); | 384 int64 unlimited_usage); |
| 375 | 385 |
| 376 // QuotaEvictionHandler. | 386 // QuotaEvictionHandler. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 478 |
| 469 struct QuotaManagerDeleter { | 479 struct QuotaManagerDeleter { |
| 470 static void Destruct(const QuotaManager* manager) { | 480 static void Destruct(const QuotaManager* manager) { |
| 471 manager->DeleteOnCorrectThread(); | 481 manager->DeleteOnCorrectThread(); |
| 472 } | 482 } |
| 473 }; | 483 }; |
| 474 | 484 |
| 475 } // namespace storage | 485 } // namespace storage |
| 476 | 486 |
| 477 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 487 #endif // STORAGE_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
| OLD | NEW |