| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 bool AddOrigin(const GURL& origin, StorageType type, base::Time modified); | 52 bool AddOrigin(const GURL& origin, StorageType type, base::Time modified); |
| 53 | 53 |
| 54 // Checks an origin and type against the origins that have been added via | 54 // Checks an origin and type against the origins that have been added via |
| 55 // AddOrigin and removed via DeleteOriginData. If the origin exists in the | 55 // AddOrigin and removed via DeleteOriginData. If the origin exists in the |
| 56 // canned list with the proper StorageType, returns true. | 56 // canned list with the proper StorageType, returns true. |
| 57 bool OriginHasData(const GURL& origin, StorageType type) const; | 57 bool OriginHasData(const GURL& origin, StorageType type) const; |
| 58 | 58 |
| 59 // Overrides QuotaManager's implementation with a canned implementation that | 59 // Overrides QuotaManager's implementation with a canned implementation that |
| 60 // allows clients to set up the origin database that should be queried. This | 60 // allows clients to set up the origin database that should be queried. This |
| 61 // method will only search through the origins added explicitly via AddOrigin. | 61 // method will only search through the origins added explicitly via AddOrigin. |
| 62 virtual void GetOriginsModifiedSince(StorageType type, | 62 virtual void GetOriginsModifiedSince( |
| 63 base::Time modified_since, | 63 StorageType type, |
| 64 GetOriginsCallback* callback) OVERRIDE; | 64 base::Time modified_since, |
| 65 const GetOriginsCallback& callback) OVERRIDE; |
| 65 | 66 |
| 66 // Removes an origin from the canned list of origins, but doesn't touch | 67 // Removes an origin from the canned list of origins, but doesn't touch |
| 67 // anything on disk. | 68 // anything on disk. |
| 68 virtual void DeleteOriginData(const GURL& origin, | 69 virtual void DeleteOriginData(const GURL& origin, |
| 69 StorageType type, | 70 StorageType type, |
| 70 StatusCallback* callback) OVERRIDE; | 71 const StatusCallback& callback) OVERRIDE; |
| 72 |
| 71 private: | 73 private: |
| 72 class GetModifiedSinceTask; | 74 class GetModifiedSinceTask; |
| 73 class DeleteOriginDataTask; | 75 class DeleteOriginDataTask; |
| 74 | 76 |
| 75 // The list of stored origins that have been added via AddOrigin. | 77 // The list of stored origins that have been added via AddOrigin. |
| 76 std::vector<OriginInfo> origins_; | 78 std::vector<OriginInfo> origins_; |
| 77 | 79 |
| 78 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); | 80 DISALLOW_COPY_AND_ASSIGN(MockQuotaManager); |
| 79 }; | 81 }; |
| 80 | 82 |
| 81 } // namespace quota | 83 } // namespace quota |
| 82 | 84 |
| 83 #endif // WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ | 85 #endif // WEBKIT_QUOTA_MOCK_QUOTA_MANAGER_H_ |
| OLD | NEW |