OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ |
6 #define CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ | 6 #define CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, | 49 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, |
50 const scoped_refptr<base::SequencedTaskRunner>& db_thread, | 50 const scoped_refptr<base::SequencedTaskRunner>& db_thread, |
51 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy); | 51 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy); |
52 | 52 |
53 // Overrides QuotaManager's implementation. The internal usage data is | 53 // Overrides QuotaManager's implementation. The internal usage data is |
54 // updated when MockQuotaManagerProxy::NotifyStorageModified() is | 54 // updated when MockQuotaManagerProxy::NotifyStorageModified() is |
55 // called. The internal quota value can be updated by calling | 55 // called. The internal quota value can be updated by calling |
56 // a helper method MockQuotaManagerProxy::SetQuota(). | 56 // a helper method MockQuotaManagerProxy::SetQuota(). |
57 void GetUsageAndQuota(const GURL& origin, | 57 void GetUsageAndQuota(const GURL& origin, |
58 storage::StorageType type, | 58 storage::StorageType type, |
59 const GetUsageAndQuotaCallback& callback) override; | 59 const UsageAndQuotaCallback& callback) override; |
60 | 60 |
61 // Overrides QuotaManager's implementation with a canned implementation that | 61 // Overrides QuotaManager's implementation with a canned implementation that |
62 // allows clients to set up the origin database that should be queried. This | 62 // allows clients to set up the origin database that should be queried. This |
63 // method will only search through the origins added explicitly via AddOrigin. | 63 // method will only search through the origins added explicitly via AddOrigin. |
64 void GetOriginsModifiedSince(StorageType type, | 64 void GetOriginsModifiedSince(StorageType type, |
65 base::Time modified_since, | 65 base::Time modified_since, |
66 const GetOriginsCallback& callback) override; | 66 const GetOriginsCallback& callback) override; |
67 | 67 |
68 // Removes an origin from the canned list of origins, but doesn't touch | 68 // Removes an origin from the canned list of origins, but doesn't touch |
69 // anything on disk. The caller must provide |quota_client_mask| which | 69 // anything on disk. The caller must provide |quota_client_mask| which |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 std::vector<OriginInfo> origins_; | 145 std::vector<OriginInfo> origins_; |
146 UsageAndQuotaMap usage_and_quota_map_; | 146 UsageAndQuotaMap usage_and_quota_map_; |
147 base::WeakPtrFactory<MockQuotaManager> weak_factory_; | 147 base::WeakPtrFactory<MockQuotaManager> weak_factory_; |
148 | 148 |
149 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); | 149 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); |
150 }; | 150 }; |
151 | 151 |
152 } // namespace content | 152 } // namespace content |
153 | 153 |
154 #endif // CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ | 154 #endif // CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ |
OLD | NEW |