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_TYPES_H_ | 5 #ifndef WEBKIT_QUOTA_QUOTA_TYPES_H_ |
6 #define WEBKIT_QUOTA_QUOTA_TYPES_H_ | 6 #define WEBKIT_QUOTA_QUOTA_TYPES_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 28 matching lines...) Expand all Loading... |
39 struct UsageInfo; | 39 struct UsageInfo; |
40 typedef std::vector<UsageInfo> UsageInfoEntries; | 40 typedef std::vector<UsageInfo> UsageInfoEntries; |
41 | 41 |
42 // Common callback types that are used throughout in the quota module. | 42 // Common callback types that are used throughout in the quota module. |
43 typedef base::Callback<void(StorageType status, | 43 typedef base::Callback<void(StorageType status, |
44 int64 usage, | 44 int64 usage, |
45 int64 unlimited_usage)> GlobalUsageCallback; | 45 int64 unlimited_usage)> GlobalUsageCallback; |
46 typedef base::Callback<void(QuotaStatusCode status, | 46 typedef base::Callback<void(QuotaStatusCode status, |
47 StorageType type, | 47 StorageType type, |
48 int64 quota)> QuotaCallback; | 48 int64 quota)> QuotaCallback; |
49 // TODO(kinuko,nhiroki): HostUsageCallback could be probably replaced with | |
50 // simple Callback<void(int64)> callback by binding host and type with Bind. | |
51 typedef base::Callback<void(int64 usage)> UsageCallback; | 49 typedef base::Callback<void(int64 usage)> UsageCallback; |
| 50 // TODO(calvinlo): Merge HostQuotaCallback and QuotaCallback |
52 typedef base::Callback<void(QuotaStatusCode status, | 51 typedef base::Callback<void(QuotaStatusCode status, |
53 const std::string& host, | |
54 StorageType type, | |
55 int64 quota)> HostQuotaCallback; | 52 int64 quota)> HostQuotaCallback; |
56 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; | 53 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; |
57 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; | 54 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; |
58 typedef base::Callback<void(const std::set<GURL>& origins, | 55 typedef base::Callback<void(const std::set<GURL>& origins, |
59 StorageType type)> GetOriginsCallback; | 56 StorageType type)> GetOriginsCallback; |
60 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; | 57 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; |
61 | 58 |
62 // Simple template wrapper for a callback queue. | 59 // Simple template wrapper for a callback queue. |
63 template <typename CallbackType> | 60 template <typename CallbackType> |
64 class CallbackQueueBase { | 61 class CallbackQueueBase { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 this->callback_map_.erase(key); | 197 this->callback_map_.erase(key); |
201 } | 198 } |
202 }; | 199 }; |
203 | 200 |
204 typedef CallbackQueueMap1<UsageCallback, std::string, int64> | 201 typedef CallbackQueueMap1<UsageCallback, std::string, int64> |
205 HostUsageCallbackMap; | 202 HostUsageCallbackMap; |
206 | 203 |
207 } // namespace quota | 204 } // namespace quota |
208 | 205 |
209 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ | 206 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ |
OLD | NEW |