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

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

Issue 16010007: Move webkit/quota files to webkit/browser/quota or webkit/common/quota (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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
« no previous file with comments | « webkit/quota/mock_storage_client.cc ('k') | webkit/quota/quota_database.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_QUOTA_QUOTA_CLIENT_H_
6 #define WEBKIT_QUOTA_QUOTA_CLIENT_H_
7
8 #include <list>
9 #include <set>
10 #include <string>
11
12 #include "base/callback.h"
13 #include "googleurl/src/gurl.h"
14 #include "webkit/quota/quota_types.h"
15 #include "webkit/storage/webkit_storage_export.h"
16
17 namespace quota {
18
19 // An abstract interface for quota manager clients.
20 // Each storage API must provide an implementation of this interface and
21 // register it to the quota manager.
22 // All the methods are assumed to be called on the IO thread in the browser.
23 class WEBKIT_STORAGE_EXPORT QuotaClient {
24 public:
25 typedef base::Callback<void(int64 usage)> GetUsageCallback;
26 typedef base::Callback<void(const std::set<GURL>& origins)>
27 GetOriginsCallback;
28 typedef base::Callback<void(QuotaStatusCode status)> DeletionCallback;
29
30 virtual ~QuotaClient() {}
31
32 enum ID {
33 kUnknown = 1 << 0,
34 kFileSystem = 1 << 1,
35 kDatabase = 1 << 2,
36 kAppcache = 1 << 3,
37 kIndexedDatabase = 1 << 4,
38 kAllClientsMask = -1,
39 };
40
41 virtual ID id() const = 0;
42
43 // Called when the quota manager is destroyed.
44 virtual void OnQuotaManagerDestroyed() = 0;
45
46 // Called by the QuotaManager.
47 // Gets the amount of data stored in the storage specified by
48 // |origin_url| and |type|.
49 // Note it is safe to fire the callback after the QuotaClient is destructed.
50 virtual void GetOriginUsage(const GURL& origin_url,
51 StorageType type,
52 const GetUsageCallback& callback) = 0;
53
54 // Called by the QuotaManager.
55 // Returns a list of origins that has data in the |type| storage.
56 // Note it is safe to fire the callback after the QuotaClient is destructed.
57 virtual void GetOriginsForType(StorageType type,
58 const GetOriginsCallback& callback) = 0;
59
60 // Called by the QuotaManager.
61 // Returns a list of origins that match the |host|.
62 // Note it is safe to fire the callback after the QuotaClient is destructed.
63 virtual void GetOriginsForHost(StorageType type,
64 const std::string& host,
65 const GetOriginsCallback& callback) = 0;
66
67 // Called by the QuotaManager.
68 // Note it is safe to fire the callback after the QuotaClient is destructed.
69 virtual void DeleteOriginData(const GURL& origin,
70 StorageType type,
71 const DeletionCallback& callback) = 0;
72 };
73
74 // TODO(dmikurube): Replace it to std::vector for efficiency.
75 typedef std::list<QuotaClient*> QuotaClientList;
76
77 } // namespace quota
78
79 #endif // WEBKIT_QUOTA_QUOTA_CLIENT_H_
OLDNEW
« no previous file with comments | « webkit/quota/mock_storage_client.cc ('k') | webkit/quota/quota_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698