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_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 13 matching lines...) Expand all Loading... |
24 const char* origin; | 24 const char* origin; |
25 StorageType type; | 25 StorageType type; |
26 int64 usage; | 26 int64 usage; |
27 }; | 27 }; |
28 | 28 |
29 // Mock storage class for testing. | 29 // Mock storage class for testing. |
30 class MockStorageClient : public QuotaClient { | 30 class MockStorageClient : public QuotaClient { |
31 public: | 31 public: |
32 MockStorageClient(QuotaManagerProxy* quota_manager_proxy, | 32 MockStorageClient(QuotaManagerProxy* quota_manager_proxy, |
33 const MockOriginData* mock_data, | 33 const MockOriginData* mock_data, |
34 size_t mock_data_size); | |
35 MockStorageClient(QuotaManagerProxy* quota_manager_proxy, | |
36 const MockOriginData* mock_data, | |
37 QuotaClient::ID id, | 34 QuotaClient::ID id, |
38 size_t mock_data_size); | 35 size_t mock_data_size); |
39 virtual ~MockStorageClient(); | 36 virtual ~MockStorageClient(); |
40 | 37 |
41 // To add or modify mock data in this client. | 38 // To add or modify mock data in this client. |
42 void AddOriginAndNotify( | 39 void AddOriginAndNotify( |
43 const GURL& origin_url, StorageType type, int64 size); | 40 const GURL& origin_url, StorageType type, int64 size); |
44 void ModifyOriginAndNotify( | 41 void ModifyOriginAndNotify( |
45 const GURL& origin_url, StorageType type, int64 delta); | 42 const GURL& origin_url, StorageType type, int64 delta); |
46 void TouchAllOriginsAndNotify(); | 43 void TouchAllOriginsAndNotify(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 int mock_time_counter_; | 86 int mock_time_counter_; |
90 | 87 |
91 base::WeakPtrFactory<MockStorageClient> weak_factory_; | 88 base::WeakPtrFactory<MockStorageClient> weak_factory_; |
92 | 89 |
93 DISALLOW_COPY_AND_ASSIGN(MockStorageClient); | 90 DISALLOW_COPY_AND_ASSIGN(MockStorageClient); |
94 }; | 91 }; |
95 | 92 |
96 } // namespace quota | 93 } // namespace quota |
97 | 94 |
98 #endif // WEBKIT_QUOTA_MOCK_STORAGE_CLIENT_H_ | 95 #endif // WEBKIT_QUOTA_MOCK_STORAGE_CLIENT_H_ |
OLD | NEW |