Index: content/public/browser/storage_partition.h |
diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h |
index b749378b1b8c1b28074678dd98862760e027f5e6..7f3e0bf94f502ed646f1b5733a7f44efbf3ee98c 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; |
@@ -127,9 +128,11 @@ 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::ClearCookiesPredicate; |
+ |
// 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 |
@@ -142,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. |