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 CONTENT_BROWER_IN_PROCESS_WEBKIT_QUOTA_CLIENT_H_ | 5 #ifndef CONTENT_BROWER_IN_PROCESS_WEBKIT_QUOTA_CLIENT_H_ |
6 #define CONTENT_BROWER_IN_PROCESS_WEBKIT_QUOTA_CLIENT_H_ | 6 #define CONTENT_BROWER_IN_PROCESS_WEBKIT_QUOTA_CLIENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 CONTENT_EXPORT IndexedDBQuotaClient( | 26 CONTENT_EXPORT IndexedDBQuotaClient( |
27 base::MessageLoopProxy* tracker_thread, | 27 base::MessageLoopProxy* tracker_thread, |
28 IndexedDBContext* indexed_db_context); | 28 IndexedDBContext* indexed_db_context); |
29 CONTENT_EXPORT virtual ~IndexedDBQuotaClient(); | 29 CONTENT_EXPORT virtual ~IndexedDBQuotaClient(); |
30 | 30 |
31 // QuotaClient method overrides | 31 // QuotaClient method overrides |
32 virtual ID id() const OVERRIDE; | 32 virtual ID id() const OVERRIDE; |
33 virtual void OnQuotaManagerDestroyed() OVERRIDE; | 33 virtual void OnQuotaManagerDestroyed() OVERRIDE; |
34 virtual void GetOriginUsage(const GURL& origin_url, | 34 virtual void GetOriginUsage(const GURL& origin_url, |
35 quota::StorageType type, | 35 quota::StorageType type, |
36 GetUsageCallback* callback) OVERRIDE; | 36 const GetUsageCallback& callback) OVERRIDE; |
37 virtual void GetOriginsForType(quota::StorageType type, | 37 virtual void GetOriginsForType(quota::StorageType type, |
38 GetOriginsCallback* callback) OVERRIDE; | 38 const GetOriginsCallback& callback) OVERRIDE; |
39 virtual void GetOriginsForHost(quota::StorageType type, | 39 virtual void GetOriginsForHost(quota::StorageType type, |
40 const std::string& host, | 40 const std::string& host, |
41 GetOriginsCallback* callback) OVERRIDE; | 41 const GetOriginsCallback& callback) OVERRIDE; |
42 virtual void DeleteOriginData(const GURL& origin, | 42 virtual void DeleteOriginData(const GURL& origin, |
43 quota::StorageType type, | 43 quota::StorageType type, |
44 DeletionCallback* callback) OVERRIDE; | 44 const DeletionCallback& callback) OVERRIDE; |
45 private: | 45 private: |
46 class HelperTask; | 46 class HelperTask; |
47 class GetOriginUsageTask; | 47 class GetOriginUsageTask; |
48 class GetOriginsTaskBase; | 48 class GetOriginsTaskBase; |
49 class GetAllOriginsTask; | 49 class GetAllOriginsTask; |
50 class GetOriginsForHostTask; | 50 class GetOriginsForHostTask; |
51 class DeleteOriginTask; | 51 class DeleteOriginTask; |
52 | 52 |
53 typedef quota::CallbackQueueMap1 | 53 typedef quota::CallbackQueueMap1 |
54 <GetUsageCallback*, | 54 <GetUsageCallback, |
55 GURL, // origin | 55 GURL, // origin |
56 int64 | 56 int64 |
57 > UsageForOriginCallbackMap; | 57 > UsageForOriginCallbackMap; |
58 typedef quota::CallbackQueue2 | 58 typedef quota::CallbackQueue2 |
59 <GetOriginsCallback*, | 59 <GetOriginsCallback, |
60 const std::set<GURL>&, | 60 const std::set<GURL>&, |
61 quota::StorageType | 61 quota::StorageType |
62 > OriginsForTypeCallbackQueue; | 62 > OriginsForTypeCallbackQueue; |
63 typedef quota::CallbackQueueMap2 | 63 typedef quota::CallbackQueueMap2 |
64 <GetOriginsCallback*, | 64 <GetOriginsCallback, |
65 std::string, // host | 65 std::string, // host |
66 const std::set<GURL>&, | 66 const std::set<GURL>&, |
67 quota::StorageType | 67 quota::StorageType |
68 > OriginsForHostCallbackMap; | 68 > OriginsForHostCallbackMap; |
69 | 69 |
70 void DidGetOriginUsage(const GURL& origin_url, int64 usage); | 70 void DidGetOriginUsage(const GURL& origin_url, int64 usage); |
71 void DidGetAllOrigins(const std::set<GURL>& origins, quota::StorageType type); | 71 void DidGetAllOrigins(const std::set<GURL>& origins, quota::StorageType type); |
72 void DidGetOriginsForHost( | 72 void DidGetOriginsForHost( |
73 const std::string& host, const std::set<GURL>& origins, | 73 const std::string& host, const std::set<GURL>& origins, |
74 quota::StorageType type); | 74 quota::StorageType type); |
75 | 75 |
76 scoped_refptr<base::MessageLoopProxy> webkit_thread_message_loop_; | 76 scoped_refptr<base::MessageLoopProxy> webkit_thread_message_loop_; |
77 scoped_refptr<IndexedDBContext> indexed_db_context_; | 77 scoped_refptr<IndexedDBContext> indexed_db_context_; |
78 UsageForOriginCallbackMap usage_for_origin_callbacks_; | 78 UsageForOriginCallbackMap usage_for_origin_callbacks_; |
79 OriginsForTypeCallbackQueue origins_for_type_callbacks_; | 79 OriginsForTypeCallbackQueue origins_for_type_callbacks_; |
80 OriginsForHostCallbackMap origins_for_host_callbacks_; | 80 OriginsForHostCallbackMap origins_for_host_callbacks_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(IndexedDBQuotaClient); | 82 DISALLOW_COPY_AND_ASSIGN(IndexedDBQuotaClient); |
83 }; | 83 }; |
84 | 84 |
85 #endif // CONTENT_BROWER_IN_PROCESS_WEBKIT_QUOTA_CLIENT_H_ | 85 #endif // CONTENT_BROWER_IN_PROCESS_WEBKIT_QUOTA_CLIENT_H_ |
OLD | NEW |