Chromium Code Reviews| 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..44f350bbae68c0f170e7cbe0f151730537aa5331 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; |
|
michaeln
2016/03/09 20:25:51
CookieMatcherFunction is a clearer and more broadl
dmurph
2016/03/10 23:00:11
mmmmmm I like the word Predicate because that's ex
|
| + |
| // 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,24 @@ 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. |
| + virtual void ClearData(uint32_t remove_mask, |
| + uint32_t quota_storage_remove_mask, |
| + const OriginMatcherFunction& origin_matcher, |
| + const CookieMatcherFunction& cookie_matcher, |
|
michaeln
2016/03/09 20:25:51
Hooray for punting to the higher level logic to so
dmurph
2016/03/10 23:00:11
:)
|
| + 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. |