| 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 19 matching lines...) Expand all Loading... |
| 30 enum QuotaLimitType { | 30 enum QuotaLimitType { |
| 31 kQuotaLimitTypeUnknown, | 31 kQuotaLimitTypeUnknown, |
| 32 kQuotaLimitTypeLimited, | 32 kQuotaLimitTypeLimited, |
| 33 kQuotaLimitTypeUnlimited, | 33 kQuotaLimitTypeUnlimited, |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 struct UsageInfo; | 36 struct UsageInfo; |
| 37 typedef std::vector<UsageInfo> UsageInfoEntries; | 37 typedef std::vector<UsageInfo> UsageInfoEntries; |
| 38 | 38 |
| 39 // Common callback types that are used throughout in the quota module. | 39 // Common callback types that are used throughout in the quota module. |
| 40 typedef base::Callback<void(StorageType status, | 40 typedef base::Callback<void(int64 usage, |
| 41 int64 usage, | |
| 42 int64 unlimited_usage)> GlobalUsageCallback; | 41 int64 unlimited_usage)> GlobalUsageCallback; |
| 43 typedef base::Callback<void(QuotaStatusCode status, int64 quota)> QuotaCallback; | 42 typedef base::Callback<void(QuotaStatusCode status, int64 quota)> QuotaCallback; |
| 44 typedef base::Callback<void(int64 usage)> UsageCallback; | 43 typedef base::Callback<void(int64 usage)> UsageCallback; |
| 45 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; | 44 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; |
| 46 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; | 45 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; |
| 47 typedef base::Callback<void(const std::set<GURL>& origins, | 46 typedef base::Callback<void(const std::set<GURL>& origins, |
| 48 StorageType type)> GetOriginsCallback; | 47 StorageType type)> GetOriginsCallback; |
| 49 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; | 48 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; |
| 50 | 49 |
| 51 template<typename CallbackType, typename Args> | 50 template<typename CallbackType, typename Args> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 75 iter != callbacks_.end(); ++iter) | 74 iter != callbacks_.end(); ++iter) |
| 76 DispatchToCallback(*iter, args); | 75 DispatchToCallback(*iter, args); |
| 77 callbacks_.clear(); | 76 callbacks_.clear(); |
| 78 } | 77 } |
| 79 | 78 |
| 80 private: | 79 private: |
| 81 std::vector<CallbackType> callbacks_; | 80 std::vector<CallbackType> callbacks_; |
| 82 }; | 81 }; |
| 83 | 82 |
| 84 typedef CallbackQueue<GlobalUsageCallback, | 83 typedef CallbackQueue<GlobalUsageCallback, |
| 85 Tuple3<StorageType, int64, int64> > | 84 Tuple2<int64, int64> > |
| 86 GlobalUsageCallbackQueue; | 85 GlobalUsageCallbackQueue; |
| 87 typedef CallbackQueue<AvailableSpaceCallback, | 86 typedef CallbackQueue<AvailableSpaceCallback, |
| 88 Tuple2<QuotaStatusCode, int64> > | 87 Tuple2<QuotaStatusCode, int64> > |
| 89 AvailableSpaceCallbackQueue; | 88 AvailableSpaceCallbackQueue; |
| 90 typedef CallbackQueue<QuotaCallback, | 89 typedef CallbackQueue<QuotaCallback, |
| 91 Tuple2<QuotaStatusCode, int64> > | 90 Tuple2<QuotaStatusCode, int64> > |
| 92 GlobalQuotaCallbackQueue; | 91 GlobalQuotaCallbackQueue; |
| 93 typedef CallbackQueue<base::Closure, Tuple0> ClosureQueue; | 92 typedef CallbackQueue<base::Closure, Tuple0> ClosureQueue; |
| 94 | 93 |
| 95 template <typename CallbackType, typename Key, typename Args> | 94 template <typename CallbackType, typename Key, typename Args> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 131 |
| 133 typedef CallbackQueueMap<UsageCallback, std::string, Tuple1<int64> > | 132 typedef CallbackQueueMap<UsageCallback, std::string, Tuple1<int64> > |
| 134 HostUsageCallbackMap; | 133 HostUsageCallbackMap; |
| 135 typedef CallbackQueueMap<QuotaCallback, std::string, | 134 typedef CallbackQueueMap<QuotaCallback, std::string, |
| 136 Tuple2<QuotaStatusCode, int64> > | 135 Tuple2<QuotaStatusCode, int64> > |
| 137 HostQuotaCallbackMap; | 136 HostQuotaCallbackMap; |
| 138 | 137 |
| 139 } // namespace quota | 138 } // namespace quota |
| 140 | 139 |
| 141 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ | 140 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ |
| OLD | NEW |