| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_QUOTA_QUOTA_MANAGER_H_ | 5 #ifndef WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| 6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 class QuotaDatabase; | 31 class QuotaDatabase; |
| 32 class UsageTracker; | 32 class UsageTracker; |
| 33 | 33 |
| 34 struct QuotaManagerDeleter; | 34 struct QuotaManagerDeleter; |
| 35 class QuotaManagerProxy; | 35 class QuotaManagerProxy; |
| 36 | 36 |
| 37 // An interface called by QuotaTemporaryStorageEvictor. | 37 // An interface called by QuotaTemporaryStorageEvictor. |
| 38 class QuotaEvictionHandler { | 38 class QuotaEvictionHandler { |
| 39 public: | 39 public: |
| 40 typedef Callback1<GURL>::Type GetLRUOriginCallback; | 40 virtual ~QuotaEvictionHandler() {} |
| 41 |
| 42 typedef Callback1<const GURL&>::Type GetLRUOriginCallback; |
| 41 typedef Callback1<QuotaStatusCode>::Type EvictOriginDataCallback; | 43 typedef Callback1<QuotaStatusCode>::Type EvictOriginDataCallback; |
| 42 typedef Callback4<QuotaStatusCode, | 44 typedef Callback4<QuotaStatusCode, |
| 43 int64 /* usage */, | 45 int64 /* usage */, |
| 44 int64 /* quota */, | 46 int64 /* quota */, |
| 45 int64 /* physical_available */ >::Type | 47 int64 /* physical_available */ >::Type |
| 46 GetUsageAndQuotaForEvictionCallback; | 48 GetUsageAndQuotaForEvictionCallback; |
| 47 | 49 |
| 48 virtual void GetLRUOrigin( | 50 virtual void GetLRUOrigin( |
| 49 StorageType type, | 51 StorageType type, |
| 50 GetLRUOriginCallback* callback) = 0; | 52 GetLRUOriginCallback* callback) = 0; |
| 51 | 53 |
| 52 virtual void EvictOriginData( | 54 virtual void EvictOriginData( |
| 53 const GURL& origin, | 55 const GURL& origin, |
| 54 StorageType type, | 56 StorageType type, |
| 55 EvictOriginDataCallback* callback) = 0; | 57 EvictOriginDataCallback* callback) = 0; |
| 56 | 58 |
| 57 virtual void GetUsageAndQuotaForEviction( | 59 virtual void GetUsageAndQuotaForEviction( |
| 58 GetUsageAndQuotaForEvictionCallback* callback) = 0; | 60 GetUsageAndQuotaForEvictionCallback* callback) = 0; |
| 59 | |
| 60 protected: | |
| 61 virtual ~QuotaEvictionHandler() {} | |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 // The quota manager class. This class is instantiated per profile and | 63 // The quota manager class. This class is instantiated per profile and |
| 65 // held by the profile. With the exception of the constructor and the | 64 // held by the profile. With the exception of the constructor and the |
| 66 // proxy() method, all methods should only be called on the IO thread. | 65 // proxy() method, all methods should only be called on the IO thread. |
| 67 class QuotaManager : public QuotaTaskObserver, | 66 class QuotaManager : public QuotaTaskObserver, |
| 68 public QuotaEvictionHandler, | 67 public QuotaEvictionHandler, |
| 69 public base::RefCountedThreadSafe< | 68 public base::RefCountedThreadSafe< |
| 70 QuotaManager, QuotaManagerDeleter> { | 69 QuotaManager, QuotaManagerDeleter> { |
| 71 public: | 70 public: |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 QuotaManager* manager_; // only accessed on the io thread | 287 QuotaManager* manager_; // only accessed on the io thread |
| 289 scoped_refptr<base::MessageLoopProxy> io_thread_; | 288 scoped_refptr<base::MessageLoopProxy> io_thread_; |
| 290 | 289 |
| 291 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); | 290 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); |
| 292 }; | 291 }; |
| 293 | 292 |
| 294 | 293 |
| 295 } // namespace quota | 294 } // namespace quota |
| 296 | 295 |
| 297 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 296 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| OLD | NEW |