Chromium Code Reviews| Index: content/public/browser/storage_partition_http_cache_data_remover.h |
| diff --git a/content/public/browser/storage_partition_http_cache_data_remover.h b/content/public/browser/storage_partition_http_cache_data_remover.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8148c574755d55baeb961e529ae0bbbeb36ed2cb |
| --- /dev/null |
| +++ b/content/public/browser/storage_partition_http_cache_data_remover.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |
| +#define CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |
| + |
| +#include "base/callback_forward.h" |
| +#include "base/time/time.h" |
| +#include "content/common/content_export.h" |
| + |
| +class GURL; |
| + |
| +namespace content { |
| + |
| +class StoragePartition; |
| + |
| +class CONTENT_EXPORT StoragePartitionHttpCacheDataRemover { |
|
Mike West
2017/03/20 11:03:37
Adding this to //content/public seems like overkil
|
| + public: |
| + // Creates a StoragePartitionHttpCacheDataRemover that deletes cache entries |
| + // in the time range between |delete_begin| (inclusively) and |delete_end| |
| + // (exclusively). |
| + static StoragePartitionHttpCacheDataRemover* CreateForRange( |
| + content::StoragePartition* storage_partition, |
| + base::Time delete_begin, |
| + base::Time delete_end); |
| + |
| + // Similar to CreateForRange(), but only deletes URLs that are matched by |
| + // |url_predicate|. Note that the deletion with URL filtering is not built in |
| + // to the cache interface and might be slower. |
| + static StoragePartitionHttpCacheDataRemover* CreateForURLsAndRange( |
| + content::StoragePartition* storage_partition, |
| + const base::Callback<bool(const GURL&)>& url_predicate, |
| + base::Time delete_begin, |
| + base::Time delete_end); |
| + |
| + // Calls |done_callback| upon completion and also destroys itself. |
| + virtual void Remove(const base::Closure& done_callback) = 0; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |