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 30 matching lines...) Expand all Loading... | |
| 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 | 49 // TODO(kinuko,nhiroki): HostUsageCallback could be probably replaced with |
| 50 // simple Callback<void(int64)> callback by binding host and type with Bind. | 50 // simple Callback<void(int64)> callback by binding host and type with Bind. |
| 51 typedef base::Callback<void(const std::string& host, | 51 typedef base::Callback<void(int64 host_usage)> HostUsageCallback; |
|
kinuko
2012/09/17 19:15:42
Now this callback type doesn't necessarily be call
calvinlo
2012/09/18 05:59:18
Done.
| |
| 52 StorageType type, | |
| 53 int64 host_usage)> HostUsageCallback; | |
| 54 typedef base::Callback<void(QuotaStatusCode status, | 52 typedef base::Callback<void(QuotaStatusCode status, |
| 55 const std::string& host, | 53 const std::string& host, |
| 56 StorageType type, | 54 StorageType type, |
| 57 int64 quota)> HostQuotaCallback; | 55 int64 quota)> HostQuotaCallback; |
| 58 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; | 56 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; |
| 59 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; | 57 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; |
| 60 typedef base::Callback<void(const std::set<GURL>& origins, | 58 typedef base::Callback<void(const std::set<GURL>& origins, |
| 61 StorageType type)> GetOriginsCallback; | 59 StorageType type)> GetOriginsCallback; |
| 62 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; | 60 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; |
| 63 | 61 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 // from the map. | 219 // from the map. |
| 222 void Run(const KEY& key, ARG1 arg1, ARG2 arg2, ARG3 arg3) { | 220 void Run(const KEY& key, ARG1 arg1, ARG2 arg2, ARG3 arg3) { |
| 223 if (!this->HasCallbacks(key)) | 221 if (!this->HasCallbacks(key)) |
| 224 return; | 222 return; |
| 225 Queue& queue = this->callback_map_[key]; | 223 Queue& queue = this->callback_map_[key]; |
| 226 queue.Run(arg1, arg2, arg3); | 224 queue.Run(arg1, arg2, arg3); |
| 227 this->callback_map_.erase(key); | 225 this->callback_map_.erase(key); |
| 228 } | 226 } |
| 229 }; | 227 }; |
| 230 | 228 |
| 231 typedef CallbackQueueMap3<HostUsageCallback, std::string, | 229 typedef CallbackQueueMap1<HostUsageCallback, std::string, int64> |
|
kinuko
2012/09/17 19:15:42
I guess we can probably remove CallbackQueueMap3 n
calvinlo
2012/09/18 05:59:18
Done.
| |
| 232 const std::string&, | 230 HostUsageCallbackMap; |
| 233 StorageType, int64> HostUsageCallbackMap; | |
| 234 | 231 |
| 235 } // namespace quota | 232 } // namespace quota |
| 236 | 233 |
| 237 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ | 234 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ |
| OLD | NEW |