Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: content/browser/browsing_data/conditional_cache_deletion_helper.h

Issue 2757923002: Move StoragePartitionHttpCacheDataRemover to content/ (Closed)
Patch Set: Rebase. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_BROWSING_DATA_CONTENT_CONDITIONAL_CACHE_DELETION_HELPER_H_ 5 #ifndef CONTENT_BROWSER_BROWSING_DATA_CONDITIONAL_CACHE_DELETION_HELPER_H_
6 #define COMPONENTS_BROWSING_DATA_CONTENT_CONDITIONAL_CACHE_DELETION_HELPER_H_ 6 #define CONTENT_BROWSER_BROWSING_DATA_CONDITIONAL_CACHE_DELETION_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "content/common/content_export.h"
12 #include "net/base/completion_callback.h" 13 #include "net/base/completion_callback.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "net/disk_cache/disk_cache.h" 15 #include "net/disk_cache/disk_cache.h"
15 #include "url/gurl.h" 16 #include "url/gurl.h"
16 17
17 namespace disk_cache { 18 namespace disk_cache {
18 class Entry; 19 class Entry;
19 } 20 }
20 21
21 namespace browsing_data { 22 namespace content {
22 23
23 // Helper to remove http cache data from a StoragePartition. 24 // Helper to remove http cache data from a StoragePartition.
24 class ConditionalCacheDeletionHelper { 25 class CONTENT_EXPORT ConditionalCacheDeletionHelper {
25 public: 26 public:
26 // Creates a helper to delete |cache| entries that match the |condition|. 27 // Creates a helper to delete |cache| entries that match the |condition|.
27 // Must be created on the IO thread! 28 // Must be created on the IO thread!
28 ConditionalCacheDeletionHelper( 29 ConditionalCacheDeletionHelper(
29 disk_cache::Backend* cache, 30 disk_cache::Backend* cache,
30 const base::Callback<bool(const disk_cache::Entry*)>& condition); 31 const base::Callback<bool(const disk_cache::Entry*)>& condition);
31 32
32 // A convenience method to create a condition matching cache entries whose 33 // A convenience method to create a condition matching cache entries whose
33 // last modified time is between |begin_time| (inclusively), |end_time| 34 // last modified time is between |begin_time| (inclusively), |end_time|
34 // (exclusively) and whose URL is matched by the |url_predicate|. Note that 35 // (exclusively) and whose URL is matched by the |url_predicate|. Note that
(...skipping 26 matching lines...) Expand all
61 62
62 net::CompletionCallback completion_callback_; 63 net::CompletionCallback completion_callback_;
63 64
64 std::unique_ptr<disk_cache::Backend::Iterator> iterator_; 65 std::unique_ptr<disk_cache::Backend::Iterator> iterator_;
65 disk_cache::Entry* current_entry_; 66 disk_cache::Entry* current_entry_;
66 disk_cache::Entry* previous_entry_; 67 disk_cache::Entry* previous_entry_;
67 68
68 DISALLOW_COPY_AND_ASSIGN(ConditionalCacheDeletionHelper); 69 DISALLOW_COPY_AND_ASSIGN(ConditionalCacheDeletionHelper);
69 }; 70 };
70 71
71 } // namespace browsing_data 72 } // namespace content
72 73
73 #endif // COMPONENTS_BROWSING_DATA_CONTENT_CONDITIONAL_CACHE_DELETION_HELPER_H_ 74 #endif // CONTENT_BROWSER_BROWSING_DATA_CONDITIONAL_CACHE_DELETION_HELPER_H_
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/browsing_data/conditional_cache_deletion_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698