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

Unified Diff: content/public/browser/storage_partition.h

Issue 1741123002: Add removal filter support for Cookies, Storage, and Content Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Android Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/storage_partition_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/storage_partition.h
diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h
index 5c4f7072b6298ef95716e7220063628ef33ead12..893a0094dac9911becc7d358ceea088302f654ec 100644
--- a/content/public/browser/storage_partition.h
+++ b/content/public/browser/storage_partition.h
@@ -13,6 +13,7 @@
#include "base/files/file_path.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
+#include "net/cookies/cookie_store.h"
class GURL;
@@ -125,13 +126,17 @@ class CONTENT_EXPORT StoragePartition {
typedef base::Callback<bool(const GURL&, storage::SpecialStoragePolicy*)>
OriginMatcherFunction;
+ // A callback type to check if a given cookie should be cleared.
+ using CookieMatcherFunction = net::CookieStore::CookiePredicate;
+
// Similar to ClearDataForOrigin().
- // Deletes all data out fo the StoragePartition if |storage_origin| is
- // nullptr.
+ // Deletes all data out for the StoragePartition if |storage_origin| is empty.
// |origin_matcher| is present if special storage policy is to be handled,
// otherwise the callback can be null (base::Callback::is_null() == true).
// |callback| is called when data deletion is done or at least the deletion is
// scheduled.
+ // storage_origin and origin_matcher_function are used for different
+ // subsystems. One does not imply the other.
virtual void ClearData(uint32_t remove_mask,
uint32_t quota_storage_remove_mask,
const GURL& storage_origin,
@@ -140,6 +145,26 @@ class CONTENT_EXPORT StoragePartition {
const base::Time end,
const base::Closure& callback) = 0;
+ // Similar to ClearData().
+ // Deletes all data out for the StoragePartition.
+ // * |origin_matcher| is present if special storage policy is to be handled,
+ // otherwise the callback should be null (base::Callback::is_null()==true).
+ // The origin matcher does not apply to cookies, instead use:
+ // * |cookies_matcher| is present if special cookie clearing is to be handled.
+ // If the callback is null all cookies withing the time range will be
+ // cleared.
+ // * |callback| is called when data deletion is done or at least the deletion
+ // is scheduled.
+ // Note: Make sure you know what you are doing before clearing cookies
+ // selectively. You don't want to break the web.
+ virtual void ClearData(uint32_t remove_mask,
+ uint32_t quota_storage_remove_mask,
+ const OriginMatcherFunction& origin_matcher,
+ const CookieMatcherFunction& cookie_matcher,
+ const base::Time begin,
+ const base::Time end,
+ const base::Closure& callback) = 0;
+
// Write any unwritten data to disk.
// Note: this method does not sync the data - it only ensures that any
// unwritten data has been written out to the filesystem.
« no previous file with comments | « content/browser/storage_partition_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698