OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_QUOTA_MANAGER_H_ | 5 #ifndef WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ |
6 #define WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ | 6 #define WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 // methods: SetQuota() and UpdateUsage(). | 24 // methods: SetQuota() and UpdateUsage(). |
25 // | 25 // |
26 // For time-based deletion test: | 26 // For time-based deletion test: |
27 // Origins can be added to the mock by calling AddOrigin, and that list of | 27 // Origins can be added to the mock by calling AddOrigin, and that list of |
28 // origins is then searched through in GetOriginsModifiedSince. | 28 // origins is then searched through in GetOriginsModifiedSince. |
29 // Neither GetOriginsModifiedSince nor DeleteOriginData touches the actual | 29 // Neither GetOriginsModifiedSince nor DeleteOriginData touches the actual |
30 // origin data stored in the profile. | 30 // origin data stored in the profile. |
31 class MockQuotaManager : public QuotaManager { | 31 class MockQuotaManager : public QuotaManager { |
32 public: | 32 public: |
33 MockQuotaManager(bool is_incognito, | 33 MockQuotaManager(bool is_incognito, |
34 const FilePath& profile_path, | 34 const base::FilePath& profile_path, |
35 base::SingleThreadTaskRunner* io_thread, | 35 base::SingleThreadTaskRunner* io_thread, |
36 base::SequencedTaskRunner* db_thread, | 36 base::SequencedTaskRunner* db_thread, |
37 SpecialStoragePolicy* special_storage_policy); | 37 SpecialStoragePolicy* special_storage_policy); |
38 | 38 |
39 // Overrides QuotaManager's implementation. The internal usage data is | 39 // Overrides QuotaManager's implementation. The internal usage data is |
40 // updated when MockQuotaManagerProxy::NotifyStorageModified() is | 40 // updated when MockQuotaManagerProxy::NotifyStorageModified() is |
41 // called. The internal quota value can be updated by calling | 41 // called. The internal quota value can be updated by calling |
42 // a helper method MockQuotaManagerProxy::SetQuota(). | 42 // a helper method MockQuotaManagerProxy::SetQuota(). |
43 virtual void GetUsageAndQuota( | 43 virtual void GetUsageAndQuota( |
44 const GURL& origin, | 44 const GURL& origin, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 GURL last_notified_origin_; | 188 GURL last_notified_origin_; |
189 StorageType last_notified_type_; | 189 StorageType last_notified_type_; |
190 int64 last_notified_delta_; | 190 int64 last_notified_delta_; |
191 | 191 |
192 QuotaClient* registered_client_; | 192 QuotaClient* registered_client_; |
193 }; | 193 }; |
194 | 194 |
195 } // namespace quota | 195 } // namespace quota |
196 | 196 |
197 #endif // WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ | 197 #endif // WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ |
OLD | NEW |