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

Unified Diff: webkit/quota/quota_types.h

Issue 10916313: Cleanup: quota::HostUsageCallback and quota::HostQuotaCallback do not need to pass host and type as… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for Kinuko Review #1 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
« no previous file with comments | « webkit/quota/quota_manager_unittest.cc ('k') | webkit/quota/usage_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/quota/quota_types.h
diff --git a/webkit/quota/quota_types.h b/webkit/quota/quota_types.h
index a66a9ca13bf3c0e698e5ad56444cfca47388dfe2..c478c96a214f9b7dc0f3d1c9aae39f0f922adce8 100644
--- a/webkit/quota/quota_types.h
+++ b/webkit/quota/quota_types.h
@@ -48,9 +48,7 @@ typedef base::Callback<void(QuotaStatusCode status,
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,
@@ -203,34 +201,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
« no previous file with comments | « webkit/quota/quota_manager_unittest.cc ('k') | webkit/quota/usage_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698