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

Unified Diff: content/browser/storage_partition_impl.h

Issue 37843003: BrowsingDataRemover, (re)use StoragePartition deletion code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from miket@ Created 7 years, 2 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: content/browser/storage_partition_impl.h
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h
index 87130e10bd877f4d96caf3375d3270079d21b6a6..86ad93d56b0fe36d65c0f2fd6ccdecbe15dba111 100644
--- a/content/browser/storage_partition_impl.h
+++ b/content/browser/storage_partition_impl.h
@@ -15,6 +15,7 @@
#include "content/browser/service_worker/service_worker_context.h"
#include "content/common/content_export.h"
#include "content/public/browser/storage_partition.h"
+#include "webkit/browser/quota/special_storage_policy.h"
namespace content {
@@ -22,6 +23,15 @@ class StoragePartitionImpl : public StoragePartition {
public:
CONTENT_EXPORT virtual ~StoragePartitionImpl();
+ // Quota managed data uses a different bitmask for types than
+ // StoragePartition uses. This method generates that mask.
+ CONTENT_EXPORT static int GenerateQuotaClientMask(uint32 remove_mask);
+
+ CONTENT_EXPORT void OverrideQuotaManagerForTesting(
+ quota::QuotaManager* quota_manager);
+ CONTENT_EXPORT void OverrideSpecialStoragePolicyForTesting(
+ quota::SpecialStoragePolicy* special_storage_policy);
+
// StoragePartition interface.
virtual base::FilePath GetPath() OVERRIDE;
virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE;
@@ -43,9 +53,17 @@ class StoragePartitionImpl : public StoragePartition {
uint32 quota_storage_remove_mask) OVERRIDE;
virtual void ClearDataForRange(uint32 remove_mask,
uint32 quota_storage_remove_mask,
- const base::Time& begin,
- const base::Time& end,
+ const base::Time begin,
+ const base::Time end,
const base::Closure& callback) OVERRIDE;
+ virtual void ClearDataForOriginWithinRange(
+ uint32 remove_mask,
+ uint32 quota_storage_remove_mask,
+ const GURL& storage_origin,
+ const OriginMatcherFunction& origin_matcher,
+ const base::Time begin,
+ const base::Time end,
+ const base::Closure& callback) OVERRIDE;
ServiceWorkerContext* GetServiceWorkerContext();
@@ -57,6 +75,30 @@ class StoragePartitionImpl : public StoragePartition {
private:
friend class StoragePartitionImplMap;
FRIEND_TEST_ALL_PREFIXES(StoragePartitionShaderClearTest, ClearShaderCache);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForeverBoth);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForeverOnlyTemporary);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForeverOnlyPersistent);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForeverOnlyPersistent);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForeverNeither);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForeverSpecificOrigin);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForLastHour);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedDataForLastWeek);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedUnprotectedOrigins);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedProtectedSpecificOrigin);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedProtectedOrigins);
+ FRIEND_TEST_ALL_PREFIXES(StoragePartitionImplTest,
+ RemoveQuotaManagedIgnoreDevTools);
// The |partition_path| is the absolute path to the root of this
// StoragePartition's on-disk storage.
@@ -68,10 +110,6 @@ class StoragePartitionImpl : public StoragePartition {
bool in_memory,
const base::FilePath& profile_path);
- // Quota managed data uses a different bitmask for types than
- // StoragePartition uses. This method generates that mask.
- static int GenerateQuotaClientMask(uint32 remove_mask);
-
CONTENT_EXPORT StoragePartitionImpl(
const base::FilePath& partition_path,
quota::QuotaManager* quota_manager,
@@ -81,11 +119,13 @@ class StoragePartitionImpl : public StoragePartition {
DOMStorageContextWrapper* dom_storage_context,
IndexedDBContextImpl* indexed_db_context,
ServiceWorkerContext* service_worker_context,
- WebRTCIdentityStore* webrtc_identity_store);
+ WebRTCIdentityStore* webrtc_identity_store,
+ quota::SpecialStoragePolicy* special_storage_policy);
void ClearDataImpl(uint32 remove_mask,
uint32 quota_storage_remove_mask,
const GURL& remove_origin,
+ const OriginMatcherFunction& origin_matcher,
net::URLRequestContextGetter* rq_context,
const base::Time begin,
const base::Time end,
@@ -118,6 +158,7 @@ class StoragePartitionImpl : public StoragePartition {
scoped_refptr<IndexedDBContextImpl> indexed_db_context_;
scoped_refptr<ServiceWorkerContext> service_worker_context_;
scoped_refptr<WebRTCIdentityStore> webrtc_identity_store_;
+ scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl);
};

Powered by Google App Engine
This is Rietveld 408576698