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

Side by Side Diff: webkit/quota/quota_types.h

Issue 7634013: Minor cleanup to UsageTracker.IsWorking(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | webkit/quota/usage_tracker.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 WEBKIT_QUOTA_QUOTA_TYPES_H_ 5 #ifndef WEBKIT_QUOTA_QUOTA_TYPES_H_
6 #define WEBKIT_QUOTA_QUOTA_TYPES_H_ 6 #define WEBKIT_QUOTA_QUOTA_TYPES_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 typedef typename CallbackMap::iterator iterator; 156 typedef typename CallbackMap::iterator iterator;
157 157
158 bool Add(const KEY& key, CallbackType callback) { 158 bool Add(const KEY& key, CallbackType callback) {
159 return callback_map_[key].Add(callback); 159 return callback_map_[key].Add(callback);
160 } 160 }
161 161
162 bool HasCallbacks(const KEY& key) const { 162 bool HasCallbacks(const KEY& key) const {
163 return (callback_map_.find(key) != callback_map_.end()); 163 return (callback_map_.find(key) != callback_map_.end());
164 } 164 }
165 165
166 bool HasAnyCallbacks() const {
167 return !callback_map_.empty();
168 }
169
166 iterator Begin() { return callback_map_.begin(); } 170 iterator Begin() { return callback_map_.begin(); }
167 iterator End() { return callback_map_.end(); } 171 iterator End() { return callback_map_.end(); }
168 172
169 void Clear() { callback_map_.clear(); } 173 void Clear() { callback_map_.clear(); }
170 174
171 protected: 175 protected:
172 CallbackMap callback_map_; 176 CallbackMap callback_map_;
173 }; 177 };
174 178
175 template <typename CallbackType1, typename KEY, typename ARG> 179 template <typename CallbackType1, typename KEY, typename ARG>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 const std::string&, 276 const std::string&,
273 StorageType, int64> HostUsageCallbackMap; 277 StorageType, int64> HostUsageCallbackMap;
274 typedef CallbackQueueMap4<HostQuotaCallback*, std::string, 278 typedef CallbackQueueMap4<HostQuotaCallback*, std::string,
275 QuotaStatusCode, 279 QuotaStatusCode,
276 const std::string&, 280 const std::string&,
277 StorageType, int64> HostQuotaCallbackMap; 281 StorageType, int64> HostQuotaCallbackMap;
278 282
279 } // namespace quota 283 } // namespace quota
280 284
281 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ 285 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_
OLDNEW
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | webkit/quota/usage_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698