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

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

Issue 7839029: QuotaManager::DeleteOriginData now allows deletion of specific QuotaClients (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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_CLIENT_H_ 5 #ifndef WEBKIT_QUOTA_QUOTA_CLIENT_H_
6 #define WEBKIT_QUOTA_QUOTA_CLIENT_H_ 6 #define WEBKIT_QUOTA_QUOTA_CLIENT_H_
7 7
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 12 matching lines...) Expand all
23 class QuotaClient { 23 class QuotaClient {
24 public: 24 public:
25 typedef Callback1<int64>::Type GetUsageCallback; 25 typedef Callback1<int64>::Type GetUsageCallback;
26 typedef Callback2<const std::set<GURL>&, StorageType>::Type 26 typedef Callback2<const std::set<GURL>&, StorageType>::Type
27 GetOriginsCallback; 27 GetOriginsCallback;
28 typedef Callback1<QuotaStatusCode>::Type DeletionCallback; 28 typedef Callback1<QuotaStatusCode>::Type DeletionCallback;
29 29
30 virtual ~QuotaClient() {} 30 virtual ~QuotaClient() {}
31 31
32 enum ID { 32 enum ID {
33 kUnknown, 33 kUnknown = 1 << 0,
34 kFileSystem, 34 kFileSystem = 1 << 1,
35 kDatabase, 35 kDatabase = 1 << 2,
36 kAppcache, 36 kAppcache = 1 << 3,
37 kIndexedDatabase, 37 kIndexedDatabase = 1 << 4,
38 kMockStart, // This needs to be the end of the enum. 38 kMockStart, // This needs to be the end of the enum.
kinuko 2011/09/26 09:43:48 what should we do if we want to test the feature w
39 }; 39 };
40 40
41 static const int kAllClientsMask = kFileSystem | kDatabase | kAppcache |
42 kIndexedDatabase;
kinuko 2011/09/26 09:43:48 -1?
43
41 virtual ID id() const = 0; 44 virtual ID id() const = 0;
42 45
43 // Called when the quota manager is destroyed. 46 // Called when the quota manager is destroyed.
44 virtual void OnQuotaManagerDestroyed() = 0; 47 virtual void OnQuotaManagerDestroyed() = 0;
45 48
46 // Called by the QuotaManager. 49 // Called by the QuotaManager.
47 // Gets the amount of data stored in the storage specified by 50 // Gets the amount of data stored in the storage specified by
48 // |origin_url| and |type|. 51 // |origin_url| and |type|.
49 virtual void GetOriginUsage(const GURL& origin_url, 52 virtual void GetOriginUsage(const GURL& origin_url,
50 StorageType type, 53 StorageType type,
51 GetUsageCallback* callback) = 0; 54 GetUsageCallback* callback) = 0;
52 55
53 // Called by the QuotaManager. 56 // Called by the QuotaManager.
54 // Returns a list of origins that has data in the |type| storage. 57 // Returns a list of origins that has data in the |type| storage.
55 virtual void GetOriginsForType(StorageType type, 58 virtual void GetOriginsForType(StorageType type,
56 GetOriginsCallback* callback) = 0; 59 GetOriginsCallback* callback) = 0;
57 60
58 // Called by the QuotaManager. 61 // Called by the QuotaManager.
59 // Returns a list of origins that match the |host|. 62 // Returns a list of origins that match the |host|.
60 virtual void GetOriginsForHost(StorageType type, 63 virtual void GetOriginsForHost(StorageType type,
61 const std::string& host, 64 const std::string& host,
62 GetOriginsCallback* callback) = 0; 65 GetOriginsCallback* callback) = 0;
63 66
64 // Called by the QuotaManager. 67 // Called by the QuotaManager.
65 virtual void DeleteOriginData(const GURL& origin, 68 virtual void DeleteOriginData(const GURL& origin,
66 StorageType type, 69 StorageType type,
67 DeletionCallback* callback) = 0; 70 DeletionCallback* callback) = 0;
68 }; 71 };
69 72
73 const int kQuotaClientAllIDsMask = QuotaClient::kFileSystem |
74 QuotaClient::kDatabase | QuotaClient::kAppcache |
75 QuotaClient::kIndexedDatabase;
kinuko 2011/09/26 09:43:48 is this a dupe of line 41?
76
70 // TODO(dmikurube): Replace it to std::vector for efficiency. 77 // TODO(dmikurube): Replace it to std::vector for efficiency.
71 typedef std::list<QuotaClient*> QuotaClientList; 78 typedef std::list<QuotaClient*> QuotaClientList;
72 79
73 } // namespace quota 80 } // namespace quota
74 81
75 #endif // WEBKIT_QUOTA_QUOTA_CLIENT_H_ 82 #endif // WEBKIT_QUOTA_QUOTA_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698