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_MOCK_STORAGE_CLIENT_H_ | 5 #ifndef WEBKIT_QUOTA_MOCK_STORAGE_CLIENT_H_ |
6 #define WEBKIT_QUOTA_MOCK_STORAGE_CLIENT_H_ | 6 #define WEBKIT_QUOTA_MOCK_STORAGE_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... |
32 // QuotaClient methods. | 32 // QuotaClient methods. |
33 virtual QuotaClient::ID id() const OVERRIDE; | 33 virtual QuotaClient::ID id() const OVERRIDE; |
34 virtual void OnQuotaManagerDestroyed() OVERRIDE; | 34 virtual void OnQuotaManagerDestroyed() OVERRIDE; |
35 virtual void GetOriginUsage(const GURL& origin_url, | 35 virtual void GetOriginUsage(const GURL& origin_url, |
36 StorageType type, | 36 StorageType type, |
37 GetUsageCallback* callback) OVERRIDE; | 37 GetUsageCallback* callback) OVERRIDE; |
38 virtual void GetOriginsForType(StorageType type, | 38 virtual void GetOriginsForType(StorageType type, |
39 GetOriginsCallback* callback) OVERRIDE; | 39 GetOriginsCallback* callback) OVERRIDE; |
40 virtual void GetOriginsForHost(StorageType type, const std::string& host, | 40 virtual void GetOriginsForHost(StorageType type, const std::string& host, |
41 GetOriginsCallback* callback) OVERRIDE; | 41 GetOriginsCallback* callback) OVERRIDE; |
| 42 virtual void DeleteOriginData(const GURL& origin, |
| 43 StorageType type, |
| 44 DeletionCallback* callback) OVERRIDE; |
42 | 45 |
43 private: | 46 private: |
44 void RunGetOriginUsage(const GURL& origin_url, | 47 void RunGetOriginUsage(const GURL& origin_url, |
45 StorageType type, | 48 StorageType type, |
46 GetUsageCallback* callback); | 49 GetUsageCallback* callback); |
47 void RunGetOriginsForType(StorageType type, | 50 void RunGetOriginsForType(StorageType type, |
48 GetOriginsCallback* callback); | 51 GetOriginsCallback* callback); |
49 void RunGetOriginsForHost(StorageType type, | 52 void RunGetOriginsForHost(StorageType type, |
50 const std::string& host, | 53 const std::string& host, |
51 GetOriginsCallback* callback); | 54 GetOriginsCallback* callback); |
| 55 void RunDeleteOriginData(const GURL& origin_url, |
| 56 StorageType type, |
| 57 DeletionCallback* callback); |
52 | 58 |
53 scoped_refptr<QuotaManagerProxy> quota_manager_proxy_; | 59 scoped_refptr<QuotaManagerProxy> quota_manager_proxy_; |
54 const ID id_; | 60 const ID id_; |
55 | 61 |
56 typedef std::map<std::pair<GURL, StorageType>, int64> OriginDataMap; | 62 typedef std::map<std::pair<GURL, StorageType>, int64> OriginDataMap; |
57 OriginDataMap origin_data_; | 63 OriginDataMap origin_data_; |
58 | 64 |
59 std::set<GetUsageCallback*> usage_callbacks_; | 65 std::set<GetUsageCallback*> usage_callbacks_; |
60 std::set<GetOriginsCallback*> origins_callbacks_; | 66 std::set<GetOriginsCallback*> origins_callbacks_; |
| 67 std::set<DeletionCallback*> deletion_callbacks_; |
61 | 68 |
62 ScopedRunnableMethodFactory<MockStorageClient> runnable_factory_; | 69 ScopedRunnableMethodFactory<MockStorageClient> runnable_factory_; |
63 | 70 |
64 DISALLOW_COPY_AND_ASSIGN(MockStorageClient); | 71 DISALLOW_COPY_AND_ASSIGN(MockStorageClient); |
65 }; | 72 }; |
66 | 73 |
67 } // namespace quota | 74 } // namespace quota |
68 | 75 |
69 #endif // WEBKIT_QUOTA_MOCK_STORAGE_CLIENT_H_ | 76 #endif // WEBKIT_QUOTA_MOCK_STORAGE_CLIENT_H_ |
OLD | NEW |