Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: webkit/quota/quota_manager.h

Issue 7002024: Implement QuotaTemporaryStorageEvictor. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Cleaned-up with using Timer. (No clean-up for the unit-test.) Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | webkit/quota/quota_temporary_storage_evictor.h » ('j') | webkit/quota/quota_temporary_storage_evictor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698