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

Unified Diff: components/browsing_data/conditional_cache_deletion_helper.h

Issue 2127403002: Make browsing_data component a layered component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed output_name from components/browsing_data/content/BUILD.gn Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/browsing_data/conditional_cache_deletion_helper.h
diff --git a/components/browsing_data/conditional_cache_deletion_helper.h b/components/browsing_data/conditional_cache_deletion_helper.h
deleted file mode 100644
index b4376b3463e3fa4cff0bfb5dcc1c816ae058277b..0000000000000000000000000000000000000000
--- a/components/browsing_data/conditional_cache_deletion_helper.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2016 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 COMPONENTS_BROWSING_DATA_CONDITIONAL_CACHE_DELETION_HELPER_H_
-#define COMPONENTS_BROWSING_DATA_CONDITIONAL_CACHE_DELETION_HELPER_H_
-
-#include <memory>
-
-#include "base/callback_forward.h"
-#include "base/message_loop/message_loop.h"
-#include "net/base/completion_callback.h"
-#include "net/base/net_errors.h"
-#include "net/disk_cache/disk_cache.h"
-#include "url/gurl.h"
-
-namespace disk_cache {
-class Entry;
-}
-
-namespace browsing_data {
-
-// Helper to remove http cache data from a StoragePartition.
-class ConditionalCacheDeletionHelper {
- public:
- // Creates a helper to delete |cache| entries that match the |condition|.
- // Must be created on the IO thread!
- ConditionalCacheDeletionHelper(
- disk_cache::Backend* cache,
- const base::Callback<bool(const disk_cache::Entry*)>& condition);
-
- // A convenience method to create a condition matching cache entries whose
- // last modified time is between |begin_time| (inclusively), |end_time|
- // (exclusively) and whose URL is matched by the |url_predicate|. Note that
- // |begin_time| and |end_time| can be null to indicate unbounded time interval
- // in their respective direction.
- static base::Callback<bool(const disk_cache::Entry*)>
- CreateURLAndTimeCondition(
- const base::Callback<bool(const GURL&)>& url_predicate,
- const base::Time& begin_time,
- const base::Time& end_time);
-
- // Deletes the cache entries according to the specified condition. Destroys
- // this instance of ConditionalCacheDeletionHelper when finished.
- // Must be called on the IO thread!
- //
- // The return value is a net error code. If this method returns
- // ERR_IO_PENDING, the |completion_callback| will be invoked when the
- // operation completes.
- int DeleteAndDestroySelfWhenFinished(
- const net::CompletionCallback& completion_callback);
-
- private:
- friend class base::DeleteHelper<ConditionalCacheDeletionHelper>;
- ~ConditionalCacheDeletionHelper();
-
- void IterateOverEntries(int error);
-
- disk_cache::Backend* cache_;
- const base::Callback<bool(const disk_cache::Entry*)> condition_;
-
- net::CompletionCallback completion_callback_;
-
- std::unique_ptr<disk_cache::Backend::Iterator> iterator_;
- disk_cache::Entry* current_entry_;
- disk_cache::Entry* previous_entry_;
-
- DISALLOW_COPY_AND_ASSIGN(ConditionalCacheDeletionHelper);
-};
-
-} // namespace browsing_data
-
-#endif // COMPONENTS_BROWSING_DATA_CONDITIONAL_CACHE_DELETION_HELPER_H_
« no previous file with comments | « components/browsing_data/browsing_data_utils.cc ('k') | components/browsing_data/conditional_cache_deletion_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698