| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ |
| 6 #define WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ | 6 #define CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 #include "webkit/browser/quota/quota_client.h" | 15 #include "webkit/browser/quota/quota_client.h" |
| 16 #include "webkit/browser/quota/quota_manager.h" | 16 #include "webkit/browser/quota/quota_manager.h" |
| 17 #include "webkit/browser/quota/quota_task.h" | 17 #include "webkit/browser/quota/quota_task.h" |
| 18 #include "webkit/common/quota/quota_types.h" | 18 #include "webkit/common/quota/quota_types.h" |
| 19 | 19 |
| 20 namespace quota { | 20 using quota::GetOriginsCallback; |
| 21 using quota::QuotaClient; |
| 22 using quota::QuotaManager; |
| 23 using quota::QuotaStatusCode; |
| 24 using quota::SpecialStoragePolicy; |
| 25 using quota::StatusCallback; |
| 26 using quota::StorageType; |
| 27 |
| 28 namespace content { |
| 21 | 29 |
| 22 // Mocks the pieces of QuotaManager's interface. | 30 // Mocks the pieces of QuotaManager's interface. |
| 23 // | 31 // |
| 24 // For usage/quota tracking test: | 32 // For usage/quota tracking test: |
| 25 // Usage and quota information can be updated by following private helper | 33 // Usage and quota information can be updated by following private helper |
| 26 // methods: SetQuota() and UpdateUsage(). | 34 // methods: SetQuota() and UpdateUsage(). |
| 27 // | 35 // |
| 28 // For time-based deletion test: | 36 // For time-based deletion test: |
| 29 // Origins can be added to the mock by calling AddOrigin, and that list of | 37 // Origins can be added to the mock by calling AddOrigin, and that list of |
| 30 // origins is then searched through in GetOriginsModifiedSince. | 38 // origins is then searched through in GetOriginsModifiedSince. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // The list of stored origins that have been added via AddOrigin. | 142 // The list of stored origins that have been added via AddOrigin. |
| 135 std::vector<OriginInfo> origins_; | 143 std::vector<OriginInfo> origins_; |
| 136 UsageAndQuotaMap usage_and_quota_map_; | 144 UsageAndQuotaMap usage_and_quota_map_; |
| 137 base::WeakPtrFactory<MockQuotaManager> weak_factory_; | 145 base::WeakPtrFactory<MockQuotaManager> weak_factory_; |
| 138 | 146 |
| 139 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); | 147 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); |
| 140 }; | 148 }; |
| 141 | 149 |
| 142 } // namespace quota | 150 } // namespace quota |
| 143 | 151 |
| 144 #endif // WEBKIT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ | 152 #endif // CONTENT_BROWSER_QUOTA_MOCK_QUOTA_MANAGER_H_ |
| OLD | NEW |