Chromium Code Reviews| 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; |
| 52 typedef base::Callback<void(QuotaStatusCode status, | 50 typedef base::Callback<void(QuotaStatusCode status, |
| 53 const std::string& host, | |
| 54 StorageType type, | |
| 55 int64 quota)> HostQuotaCallback; | 51 int64 quota)> HostQuotaCallback; |
|
kinuko
2012/09/19 09:29:24
nit: can you add a TODO comment to note that we sh
calvinlo
2012/09/19 11:20:51
Done.
| |
| 56 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; | 52 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; |
| 57 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; | 53 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; |
| 58 typedef base::Callback<void(const std::set<GURL>& origins, | 54 typedef base::Callback<void(const std::set<GURL>& origins, |
| 59 StorageType type)> GetOriginsCallback; | 55 StorageType type)> GetOriginsCallback; |
| 60 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; | 56 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; |
| 61 | 57 |
| 62 // Simple template wrapper for a callback queue. | 58 // Simple template wrapper for a callback queue. |
| 63 template <typename CallbackType> | 59 template <typename CallbackType> |
| 64 class CallbackQueueBase { | 60 class CallbackQueueBase { |
| 65 public: | 61 public: |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 this->callback_map_.erase(key); | 196 this->callback_map_.erase(key); |
| 201 } | 197 } |
| 202 }; | 198 }; |
| 203 | 199 |
| 204 typedef CallbackQueueMap1<UsageCallback, std::string, int64> | 200 typedef CallbackQueueMap1<UsageCallback, std::string, int64> |
| 205 HostUsageCallbackMap; | 201 HostUsageCallbackMap; |
| 206 | 202 |
| 207 } // namespace quota | 203 } // namespace quota |
| 208 | 204 |
| 209 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ | 205 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ |
| OLD | NEW |