Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Unified Diff: webkit/quota/quota_types.h

Issue 10948006: Cleanup: quota::HostQuotaCallback do not need to pass host and type as arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unittests somehow missed in previous patch Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/quota/quota_types.h
diff --git a/webkit/quota/quota_types.h b/webkit/quota/quota_types.h
index a66a9ca13bf3c0e698e5ad56444cfca47388dfe2..ca6103b2228b32d380cd3010e22e16b74a88a47e 100644
--- a/webkit/quota/quota_types.h
+++ b/webkit/quota/quota_types.h
@@ -46,14 +46,8 @@ typedef base::Callback<void(StorageType status,
typedef base::Callback<void(QuotaStatusCode status,
StorageType type,
int64 quota)> QuotaCallback;
-// TODO(kinuko,nhiroki): HostUsageCallback could be probably replaced with
-// simple Callback<void(int64)> callback by binding host and type with Bind.
-typedef base::Callback<void(const std::string& host,
- StorageType type,
- int64 host_usage)> HostUsageCallback;
+typedef base::Callback<void(int64 usage)> UsageCallback;
typedef base::Callback<void(QuotaStatusCode status,
- const std::string& host,
- StorageType type,
int64 quota)> HostQuotaCallback;
typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback;
typedef base::Callback<void(QuotaStatusCode)> StatusCallback;
@@ -203,34 +197,8 @@ class CallbackQueueMap2
}
};
-template <typename CallbackType3, typename KEY,
- typename ARG1, typename ARG2, typename ARG3>
-class CallbackQueueMap3
- : public CallbackQueueMapBase<CallbackType3,
- CallbackQueue3<CallbackType3,
- ARG1, ARG2, ARG3>,
- KEY> {
- public:
- typedef typename CallbackQueueMapBase<
- CallbackType3,
- CallbackQueue3<CallbackType3, ARG1, ARG2, ARG3>,
- KEY>::iterator iterator;
- typedef CallbackQueue3<CallbackType3, ARG1, ARG2, ARG3> Queue;
-
- // Runs the callbacks added for the given |key| and clears the key
- // from the map.
- void Run(const KEY& key, ARG1 arg1, ARG2 arg2, ARG3 arg3) {
- if (!this->HasCallbacks(key))
- return;
- Queue& queue = this->callback_map_[key];
- queue.Run(arg1, arg2, arg3);
- this->callback_map_.erase(key);
- }
-};
-
-typedef CallbackQueueMap3<HostUsageCallback, std::string,
- const std::string&,
- StorageType, int64> HostUsageCallbackMap;
+typedef CallbackQueueMap1<UsageCallback, std::string, int64>
+ HostUsageCallbackMap;
} // namespace quota

Powered by Google App Engine
This is Rietveld 408576698