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

Side by Side Diff: storage/browser/quota/quota_callbacks.h

Issue 1102353009: WIP Durable storage, chrome side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | storage/browser/quota/quota_database.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 STORAGE_BROWSER_QUOTA_QUOTA_CALLBACKS_H_ 5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_CALLBACKS_H_
6 #define STORAGE_BROWSER_QUOTA_QUOTA_CALLBACKS_H_ 6 #define STORAGE_BROWSER_QUOTA_QUOTA_CALLBACKS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 // Common callback types that are used throughout in the quota module. 24 // Common callback types that are used throughout in the quota module.
25 typedef base::Callback<void(int64 usage, 25 typedef base::Callback<void(int64 usage,
26 int64 unlimited_usage)> GlobalUsageCallback; 26 int64 unlimited_usage)> GlobalUsageCallback;
27 typedef base::Callback<void(QuotaStatusCode status, int64 quota)> QuotaCallback; 27 typedef base::Callback<void(QuotaStatusCode status, int64 quota)> QuotaCallback;
28 typedef base::Callback<void(int64 usage)> UsageCallback; 28 typedef base::Callback<void(int64 usage)> UsageCallback;
29 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback; 29 typedef base::Callback<void(QuotaStatusCode, int64)> AvailableSpaceCallback;
30 typedef base::Callback<void(QuotaStatusCode)> StatusCallback; 30 typedef base::Callback<void(QuotaStatusCode)> StatusCallback;
31 typedef base::Callback<void(const std::set<GURL>& origins, 31 typedef base::Callback<void(const std::set<GURL>& origins,
32 StorageType type)> GetOriginsCallback; 32 StorageType type)> GetOriginsCallback;
33 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback; 33 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback;
34 typedef base::Callback<void(QuotaStatusCode, bool)> GetDurabilityCallback;
34 35
35 // Simple template wrapper for a callback queue. 36 // Simple template wrapper for a callback queue.
36 template <typename CallbackType, typename... Args> 37 template <typename CallbackType, typename... Args>
37 class CallbackQueue { 38 class CallbackQueue {
38 public: 39 public:
39 // Returns true if the given |callback| is the first one added to the queue. 40 // Returns true if the given |callback| is the first one added to the queue.
40 bool Add(const CallbackType& callback) { 41 bool Add(const CallbackType& callback) {
41 callbacks_.push_back(callback); 42 callbacks_.push_back(callback);
42 return (callbacks_.size() == 1); 43 return (callbacks_.size() == 1);
43 } 44 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 queue.Run(base::internal::CallbackForward(args)...); 101 queue.Run(base::internal::CallbackForward(args)...);
101 } 102 }
102 103
103 private: 104 private:
104 CallbackMap callback_map_; 105 CallbackMap callback_map_;
105 }; 106 };
106 107
107 } // namespace storage 108 } // namespace storage
108 109
109 #endif // STORAGE_QUOTA_QUOTA_TYPES_H_ 110 #endif // STORAGE_QUOTA_QUOTA_TYPES_H_
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | storage/browser/quota/quota_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698