OLD | NEW |
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> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback_old.h" | 14 #include "base/callback_old.h" |
15 #include "base/stl_util-inl.h" | 15 #include "base/stl_util-inl.h" |
16 | 16 |
| 17 class GURL; |
| 18 |
17 namespace quota { | 19 namespace quota { |
18 | 20 |
19 enum StorageType { | 21 enum StorageType { |
20 kStorageTypeTemporary, | 22 kStorageTypeTemporary, |
21 kStorageTypePersistent, | 23 kStorageTypePersistent, |
22 kStorageTypeUnknown, | 24 kStorageTypeUnknown, |
23 }; | 25 }; |
24 | 26 |
25 // TODO(tzik): Add assertions to | 27 // TODO(tzik): Add assertions to |
26 // content/browser/renderer_host/quota_dispatcher_host.cc | 28 // content/browser/renderer_host/quota_dispatcher_host.cc |
(...skipping 16 matching lines...) Expand all Loading... |
43 typedef Callback3<const std::string& /* host */, | 45 typedef Callback3<const std::string& /* host */, |
44 StorageType, | 46 StorageType, |
45 int64>::Type HostUsageCallback; | 47 int64>::Type HostUsageCallback; |
46 typedef Callback4<QuotaStatusCode, | 48 typedef Callback4<QuotaStatusCode, |
47 const std::string& /* host */, | 49 const std::string& /* host */, |
48 StorageType, | 50 StorageType, |
49 int64>::Type HostQuotaCallback; | 51 int64>::Type HostQuotaCallback; |
50 typedef Callback2<QuotaStatusCode, | 52 typedef Callback2<QuotaStatusCode, |
51 int64>::Type AvailableSpaceCallback; | 53 int64>::Type AvailableSpaceCallback; |
52 typedef Callback1<QuotaStatusCode>::Type StatusCallback; | 54 typedef Callback1<QuotaStatusCode>::Type StatusCallback; |
| 55 typedef Callback1<const std::set<GURL>&>::Type GetOriginsCallback; |
53 | 56 |
54 // Simple template wrapper for a callback queue. | 57 // Simple template wrapper for a callback queue. |
55 template <typename CallbackType> | 58 template <typename CallbackType> |
56 class CallbackQueueBase { | 59 class CallbackQueueBase { |
57 public: | 60 public: |
58 typedef typename std::deque<CallbackType> Queue; | 61 typedef typename std::deque<CallbackType> Queue; |
59 typedef typename Queue::iterator iterator; | 62 typedef typename Queue::iterator iterator; |
60 | 63 |
61 virtual ~CallbackQueueBase() { | 64 virtual ~CallbackQueueBase() { |
62 STLDeleteContainerPointers(callbacks_.begin(), callbacks_.end()); | 65 STLDeleteContainerPointers(callbacks_.begin(), callbacks_.end()); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 const std::string&, | 272 const std::string&, |
270 StorageType, int64> HostUsageCallbackMap; | 273 StorageType, int64> HostUsageCallbackMap; |
271 typedef CallbackQueueMap4<HostQuotaCallback*, std::string, | 274 typedef CallbackQueueMap4<HostQuotaCallback*, std::string, |
272 QuotaStatusCode, | 275 QuotaStatusCode, |
273 const std::string&, | 276 const std::string&, |
274 StorageType, int64> HostQuotaCallbackMap; | 277 StorageType, int64> HostQuotaCallbackMap; |
275 | 278 |
276 } // namespace quota | 279 } // namespace quota |
277 | 280 |
278 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ | 281 #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ |
OLD | NEW |