| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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> |
| 11 | 11 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 23 class QuotaClient { | 23 class QuotaClient { |
| 24 public: | 24 public: |
| 25 typedef base::Callback<void(int64)> GetUsageCallback; // NOLINT | 25 typedef base::Callback<void(int64)> GetUsageCallback; // NOLINT |
| 26 typedef base::Callback<void(const std::set<GURL>&, StorageType)> | 26 typedef base::Callback<void(const std::set<GURL>&, StorageType)> |
| 27 GetOriginsCallback; | 27 GetOriginsCallback; |
| 28 typedef base::Callback<void(QuotaStatusCode)> DeletionCallback; | 28 typedef base::Callback<void(QuotaStatusCode)> 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 = 1 << 5, // This needs to be the end of the enum. |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 static const int kAllClientsMask = -1; |
| 42 |
| 41 virtual ID id() const = 0; | 43 virtual ID id() const = 0; |
| 42 | 44 |
| 43 // Called when the quota manager is destroyed. | 45 // Called when the quota manager is destroyed. |
| 44 virtual void OnQuotaManagerDestroyed() = 0; | 46 virtual void OnQuotaManagerDestroyed() = 0; |
| 45 | 47 |
| 46 // Called by the QuotaManager. | 48 // Called by the QuotaManager. |
| 47 // Gets the amount of data stored in the storage specified by | 49 // Gets the amount of data stored in the storage specified by |
| 48 // |origin_url| and |type|. | 50 // |origin_url| and |type|. |
| 49 virtual void GetOriginUsage(const GURL& origin_url, | 51 virtual void GetOriginUsage(const GURL& origin_url, |
| 50 StorageType type, | 52 StorageType type, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 66 StorageType type, | 68 StorageType type, |
| 67 const DeletionCallback& callback) = 0; | 69 const DeletionCallback& callback) = 0; |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 // TODO(dmikurube): Replace it to std::vector for efficiency. | 72 // TODO(dmikurube): Replace it to std::vector for efficiency. |
| 71 typedef std::list<QuotaClient*> QuotaClientList; | 73 typedef std::list<QuotaClient*> QuotaClientList; |
| 72 | 74 |
| 73 } // namespace quota | 75 } // namespace quota |
| 74 | 76 |
| 75 #endif // WEBKIT_QUOTA_QUOTA_CLIENT_H_ | 77 #endif // WEBKIT_QUOTA_QUOTA_CLIENT_H_ |
| OLD | NEW |