Index: content/browser/browsing_data/storage_partition_http_cache_data_remover_impl.h |
diff --git a/components/browsing_data/content/storage_partition_http_cache_data_remover.h b/content/browser/browsing_data/storage_partition_http_cache_data_remover_impl.h |
similarity index 52% |
rename from components/browsing_data/content/storage_partition_http_cache_data_remover.h |
rename to content/browser/browsing_data/storage_partition_http_cache_data_remover_impl.h |
index 8d11a4ffa6f36cd249340eaf5c58b12bbd287d86..0e1ffc3424cb7096531f839ddf8b18df1fdc5566 100644 |
--- a/components/browsing_data/content/storage_partition_http_cache_data_remover.h |
+++ b/content/browser/browsing_data/storage_partition_http_cache_data_remover_impl.h |
@@ -2,21 +2,16 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef COMPONENTS_BROWSING_DATA_CONTENT_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |
-#define COMPONENTS_BROWSING_DATA_CONTENT_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |
+#ifndef CONTENT_BROWSER_BROWSING_DATA_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |
+#define CONTENT_BROWSER_BROWSING_DATA_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |
#include <stdint.h> |
#include "base/callback.h" |
#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
#include "base/sequenced_task_runner_helpers.h" |
-#include "base/time/time.h" |
-#include "net/base/completion_callback.h" |
-#include "url/gurl.h" |
- |
-namespace content { |
-class StoragePartition; |
-} |
+#include "content/public/browser/storage_partition_http_cache_data_remover.h" |
namespace disk_cache { |
class Backend; |
@@ -26,30 +21,16 @@ namespace net { |
class URLRequestContextGetter; |
} |
-namespace browsing_data { |
+namespace content { |
+ |
+class StoragePartition; |
// Helper to remove http cache data from a StoragePartition. |
-class StoragePartitionHttpCacheDataRemover { |
+class StoragePartitionHttpCacheDataRemoverImpl |
+ : public StoragePartitionHttpCacheDataRemover { |
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. |
- void Remove(const base::Closure& done_callback); |
+ // StoragePartitionHttpCacheDataRemover: |
+ void Remove(const base::Closure& done_callback) override; |
private: |
enum CacheState { |
@@ -61,19 +42,23 @@ class StoragePartitionHttpCacheDataRemover { |
DONE |
}; |
- StoragePartitionHttpCacheDataRemover( |
+ StoragePartitionHttpCacheDataRemoverImpl( |
base::Callback<bool(const GURL&)> url_predicate, |
base::Time delete_begin, |
base::Time delete_end, |
net::URLRequestContextGetter* main_context_getter, |
net::URLRequestContextGetter* media_context_getter); |
+ // This class can be constructed using the Create() methods in the public |
+ // interface. |
+ friend class StoragePartitionHttpCacheDataRemover; |
+ |
// StoragePartitionHttpCacheDataRemover deletes itself (using DeleteHelper) |
// and is not supposed to be deleted by other objects so make destructor |
// private and DeleteHelper a friend. |
- friend class base::DeleteHelper<StoragePartitionHttpCacheDataRemover>; |
+ friend class base::DeleteHelper<StoragePartitionHttpCacheDataRemoverImpl>; |
- ~StoragePartitionHttpCacheDataRemover(); |
+ virtual ~StoragePartitionHttpCacheDataRemoverImpl(); |
void ClearHttpCacheOnIOThread(); |
void ClearedHttpCache(); |
@@ -93,9 +78,9 @@ class StoragePartitionHttpCacheDataRemover { |
int next_cache_state_; |
disk_cache::Backend* cache_; |
- DISALLOW_COPY_AND_ASSIGN(StoragePartitionHttpCacheDataRemover); |
+ DISALLOW_COPY_AND_ASSIGN(StoragePartitionHttpCacheDataRemoverImpl); |
}; |
-} // namespace browsing_data |
+} // namespace content |
-#endif // COMPONENTS_BROWSING_DATA_CONTENT_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |
+#endif // CONTENT_BROWSER_BROWSING_DATA_STORAGE_PARTITION_HTTP_CACHE_DATA_REMOVER_H_ |