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

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

Issue 1394563002: Add trace to the caller of QuotaManager::GetAvailableSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 std::vector<CallbackType> callbacks; 53 std::vector<CallbackType> callbacks;
54 callbacks.swap(callbacks_); 54 callbacks.swap(callbacks_);
55 for (const auto& callback : callbacks) 55 for (const auto& callback : callbacks)
56 callback.Run(base::internal::CallbackForward(args)...); 56 callback.Run(base::internal::CallbackForward(args)...);
57 } 57 }
58 58
59 void Swap(CallbackQueue<CallbackType, Args...>* other) { 59 void Swap(CallbackQueue<CallbackType, Args...>* other) {
60 callbacks_.swap(other->callbacks_); 60 callbacks_.swap(other->callbacks_);
61 } 61 }
62 62
63 size_t size() const {
64 return callbacks_.size();
65 }
66
63 private: 67 private:
64 std::vector<CallbackType> callbacks_; 68 std::vector<CallbackType> callbacks_;
65 }; 69 };
66 70
67 template <typename CallbackType, typename Key, typename... Args> 71 template <typename CallbackType, typename Key, typename... Args>
68 class CallbackQueueMap { 72 class CallbackQueueMap {
69 public: 73 public:
70 typedef CallbackQueue<CallbackType, Args...> CallbackQueueType; 74 typedef CallbackQueue<CallbackType, Args...> CallbackQueueType;
71 typedef std::map<Key, CallbackQueueType> CallbackMap; 75 typedef std::map<Key, CallbackQueueType> CallbackMap;
72 typedef typename CallbackMap::iterator iterator; 76 typedef typename CallbackMap::iterator iterator;
(...skipping 28 matching lines...) Expand all
101 queue.Run(base::internal::CallbackForward(args)...); 105 queue.Run(base::internal::CallbackForward(args)...);
102 } 106 }
103 107
104 private: 108 private:
105 CallbackMap callback_map_; 109 CallbackMap callback_map_;
106 }; 110 };
107 111
108 } // namespace storage 112 } // namespace storage
109 113
110 #endif // STORAGE_QUOTA_QUOTA_TYPES_H_ 114 #endif // STORAGE_QUOTA_QUOTA_TYPES_H_
OLDNEW
« no previous file with comments | « storage/browser/fileapi/sandbox_file_stream_writer.cc ('k') | storage/browser/quota/quota_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698