| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 int quota_client_mask; | 40 int quota_client_mask; |
| 41 base::Time modified; | 41 base::Time modified; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 MockQuotaManager(bool is_incognito, | 44 MockQuotaManager(bool is_incognito, |
| 45 const FilePath& profile_path, | 45 const FilePath& profile_path, |
| 46 base::MessageLoopProxy* io_thread, | 46 base::MessageLoopProxy* io_thread, |
| 47 base::MessageLoopProxy* db_thread, | 47 base::MessageLoopProxy* db_thread, |
| 48 SpecialStoragePolicy* special_storage_policy); | 48 SpecialStoragePolicy* special_storage_policy); |
| 49 | 49 |
| 50 virtual ~MockQuotaManager(); | |
| 51 | |
| 52 // Adds an origin to the canned list that will be searched through via | 50 // Adds an origin to the canned list that will be searched through via |
| 53 // GetOriginsModifiedSince. The caller must provide |quota_client_mask| | 51 // GetOriginsModifiedSince. The caller must provide |quota_client_mask| |
| 54 // which specifies the types of QuotaClients this canned origin contains | 52 // which specifies the types of QuotaClients this canned origin contains |
| 55 // as a bitmask built from QuotaClient::IDs. | 53 // as a bitmask built from QuotaClient::IDs. |
| 56 bool AddOrigin(const GURL& origin, | 54 bool AddOrigin(const GURL& origin, |
| 57 StorageType type, | 55 StorageType type, |
| 58 int quota_client_mask, | 56 int quota_client_mask, |
| 59 base::Time modified); | 57 base::Time modified); |
| 60 | 58 |
| 61 // Checks an origin and type against the origins that have been added via | 59 // Checks an origin and type against the origins that have been added via |
| (...skipping 15 matching lines...) Expand all Loading... |
| 77 // anything on disk. The caller must provide |quota_client_mask| which | 75 // anything on disk. The caller must provide |quota_client_mask| which |
| 78 // specifies the types of QuotaClients which should be removed from this | 76 // specifies the types of QuotaClients which should be removed from this |
| 79 // origin as a bitmask built from QuotaClient::IDs. Setting the mask to | 77 // origin as a bitmask built from QuotaClient::IDs. Setting the mask to |
| 80 // QuotaClient::kAllClientsMask will remove all clients from the origin, | 78 // QuotaClient::kAllClientsMask will remove all clients from the origin, |
| 81 // regardless of type. | 79 // regardless of type. |
| 82 virtual void DeleteOriginData(const GURL& origin, | 80 virtual void DeleteOriginData(const GURL& origin, |
| 83 StorageType type, | 81 StorageType type, |
| 84 int quota_client_mask, | 82 int quota_client_mask, |
| 85 const StatusCallback& callback) OVERRIDE; | 83 const StatusCallback& callback) OVERRIDE; |
| 86 | 84 |
| 85 protected: |
| 86 virtual ~MockQuotaManager(); |
| 87 |
| 87 private: | 88 private: |
| 88 class GetModifiedSinceTask; | 89 class GetModifiedSinceTask; |
| 89 class DeleteOriginDataTask; | 90 class DeleteOriginDataTask; |
| 90 | 91 |
| 91 // The list of stored origins that have been added via AddOrigin. | 92 // The list of stored origins that have been added via AddOrigin. |
| 92 std::vector<OriginInfo> origins_; | 93 std::vector<OriginInfo> origins_; |
| 93 | 94 |
| 94 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); | 95 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 } // namespace quota | 98 } // namespace quota |
| 98 | 99 |
| 99 #endif // WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ | 100 #endif // WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ |
| OLD | NEW |