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