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 virtual ~QuotaEvictionHandler() {} | |
kinuko
2011/05/25 06:31:38
You may want to give your answer why this needs to
Dai Mikurube (NOT FULLTIME)
2011/05/25 07:20:37
Ah, I moved that because of error when mocking thi
| |
41 | |
40 typedef Callback1<const GURL&>::Type GetLRUOriginCallback; | 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 // Returns the least recently used origin. It might return empty | 50 // Returns the least recently used origin. It might return empty |
49 // GURL when there are no evictable origins. | 51 // GURL when there are no evictable origins. |
50 virtual void GetLRUOrigin( | 52 virtual void GetLRUOrigin( |
51 StorageType type, | 53 StorageType type, |
52 GetLRUOriginCallback* callback) = 0; | 54 GetLRUOriginCallback* callback) = 0; |
53 | 55 |
54 virtual void EvictOriginData( | 56 virtual void EvictOriginData( |
55 const GURL& origin, | 57 const GURL& origin, |
56 StorageType type, | 58 StorageType type, |
57 EvictOriginDataCallback* callback) = 0; | 59 EvictOriginDataCallback* callback) = 0; |
58 | 60 |
59 virtual void GetUsageAndQuotaForEviction( | 61 virtual void GetUsageAndQuotaForEviction( |
60 GetUsageAndQuotaForEvictionCallback* callback) = 0; | 62 GetUsageAndQuotaForEvictionCallback* callback) = 0; |
61 | |
62 protected: | |
63 virtual ~QuotaEvictionHandler() {} | |
64 }; | 63 }; |
65 | 64 |
66 // The quota manager class. This class is instantiated per profile and | 65 // The quota manager class. This class is instantiated per profile and |
67 // held by the profile. With the exception of the constructor and the | 66 // held by the profile. With the exception of the constructor and the |
68 // proxy() method, all methods should only be called on the IO thread. | 67 // proxy() method, all methods should only be called on the IO thread. |
69 class QuotaManager : public QuotaTaskObserver, | 68 class QuotaManager : public QuotaTaskObserver, |
70 public QuotaEvictionHandler, | 69 public QuotaEvictionHandler, |
71 public base::RefCountedThreadSafe< | 70 public base::RefCountedThreadSafe< |
72 QuotaManager, QuotaManagerDeleter> { | 71 QuotaManager, QuotaManagerDeleter> { |
73 public: | 72 public: |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 QuotaManager* manager_; // only accessed on the io thread | 302 QuotaManager* manager_; // only accessed on the io thread |
304 scoped_refptr<base::MessageLoopProxy> io_thread_; | 303 scoped_refptr<base::MessageLoopProxy> io_thread_; |
305 | 304 |
306 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); | 305 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); |
307 }; | 306 }; |
308 | 307 |
309 | 308 |
310 } // namespace quota | 309 } // namespace quota |
311 | 310 |
312 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 311 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
OLD | NEW |