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

Unified Diff: storage/browser/quota/quota_callbacks.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 | « storage/browser/quota/OWNERS ('k') | storage/browser/quota/quota_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/quota/quota_callbacks.h
diff --git a/webkit/browser/quota/quota_callbacks.h b/storage/browser/quota/quota_callbacks.h
similarity index 70%
rename from webkit/browser/quota/quota_callbacks.h
rename to storage/browser/quota/quota_callbacks.h
index 84f52c058763b941676d2f905750221ccce945d2..68c040f1938c6617379327e7861548f8f1dff7d4 100644
--- a/webkit/browser/quota/quota_callbacks.h
+++ b/storage/browser/quota/quota_callbacks.h
@@ -13,8 +13,8 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/tuple.h"
-#include "webkit/common/quota/quota_status_code.h"
-#include "webkit/common/quota/quota_types.h"
+#include "storage/common/quota/quota_status_code.h"
+#include "storage/common/quota/quota_types.h"
class GURL;
@@ -24,19 +24,18 @@ struct UsageInfo;
typedef std::vector<UsageInfo> UsageInfoEntries;
// Common callback types that are used throughout in the quota module.
-typedef base::Callback<void(int64 usage,
- int64 unlimited_usage)> GlobalUsageCallback;
+typedef base::Callback<void(int64 usage, int64 unlimited_usage)>
+ GlobalUsageCallback;
typedef base::Callback<void(QuotaStatusCode status, int64 quota)> QuotaCallback;
typedef base::Callback<void(int64 usage)> UsageCallback;
typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback;
typedef base::Callback<void(QuotaStatusCode)> StatusCallback;
-typedef base::Callback<void(const std::set<GURL>& origins,
- StorageType type)> GetOriginsCallback;
+typedef base::Callback<void(const std::set<GURL>& origins, StorageType type)>
+ GetOriginsCallback;
typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback;
-template<typename CallbackType, typename Args>
-void DispatchToCallback(const CallbackType& callback,
- const Args& args) {
+template <typename CallbackType, typename Args>
+void DispatchToCallback(const CallbackType& callback, const Args& args) {
DispatchToMethod(&callback, &CallbackType::Run, args);
}
@@ -50,15 +49,12 @@ class CallbackQueue {
return (callbacks_.size() == 1);
}
- bool HasCallbacks() const {
- return !callbacks_.empty();
- }
+ bool HasCallbacks() const { return !callbacks_.empty(); }
// Runs the callbacks added to the queue and clears the queue.
void Run(const Args& args) {
typedef typename std::vector<CallbackType>::iterator iterator;
- for (iterator iter = callbacks_.begin();
- iter != callbacks_.end(); ++iter)
+ for (iterator iter = callbacks_.begin(); iter != callbacks_.end(); ++iter)
DispatchToCallback(*iter, args);
callbacks_.clear();
}
@@ -67,16 +63,12 @@ class CallbackQueue {
std::vector<CallbackType> callbacks_;
};
-typedef CallbackQueue<GlobalUsageCallback,
- Tuple2<int64, int64> >
+typedef CallbackQueue<GlobalUsageCallback, Tuple2<int64, int64> >
GlobalUsageCallbackQueue;
-typedef CallbackQueue<UsageCallback, Tuple1<int64> >
- UsageCallbackQueue;
-typedef CallbackQueue<AvailableSpaceCallback,
- Tuple2<QuotaStatusCode, int64> >
+typedef CallbackQueue<UsageCallback, Tuple1<int64> > UsageCallbackQueue;
+typedef CallbackQueue<AvailableSpaceCallback, Tuple2<QuotaStatusCode, int64> >
AvailableSpaceCallbackQueue;
-typedef CallbackQueue<QuotaCallback,
- Tuple2<QuotaStatusCode, int64> >
+typedef CallbackQueue<QuotaCallback, Tuple2<QuotaStatusCode, int64> >
GlobalQuotaCallbackQueue;
typedef CallbackQueue<base::Closure, Tuple0> ClosureQueue;
@@ -95,9 +87,7 @@ class CallbackQueueMap {
return (callback_map_.find(key) != callback_map_.end());
}
- bool HasAnyCallbacks() const {
- return !callback_map_.empty();
- }
+ bool HasAnyCallbacks() const { return !callback_map_.empty(); }
iterator Begin() { return callback_map_.begin(); }
iterator End() { return callback_map_.end(); }
@@ -120,9 +110,9 @@ class CallbackQueueMap {
typedef CallbackQueueMap<UsageCallback, std::string, Tuple1<int64> >
HostUsageCallbackMap;
-typedef CallbackQueueMap<QuotaCallback, std::string,
- Tuple2<QuotaStatusCode, int64> >
- HostQuotaCallbackMap;
+typedef CallbackQueueMap<QuotaCallback,
+ std::string,
+ Tuple2<QuotaStatusCode, int64> > HostQuotaCallbackMap;
} // namespace quota
« no previous file with comments | « storage/browser/quota/OWNERS ('k') | storage/browser/quota/quota_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698