From fdf3e13c44fd319d3cc186ea46eebfb0eafe53ad Mon Sep 17 00:00:00 2001 From: "lazyboy@chromium.org" Date: Wed, 31 Jul 2013 06:23:46 +0000 Subject: Add support for selectively deleting different bits of StoragePartition related data. Reland r213582 after fixing memory leak (via LeakSanitizer). This CL makes the deletion work similar to BrowsingDataRemover in chrome/. This CL is a result of the discussion in crrev.com/16188005 BUG=174763,180118,264188 Test=built: libwebviewchromium, manually tested with browser plugin guest's storage partition, checked clearing cookies and local storage data. Ran unit_tests target with LeakSanitizer/"detect_leaks=1" Review URL: https://chromiumcodereview.appspot.com/20543002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214585 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/storage_partition_impl.h | 35 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'content/browser/storage_partition_impl.h') diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index 9dcdfec..0410f4d 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h @@ -31,19 +31,26 @@ class StoragePartitionImpl : public StoragePartition { virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; virtual DOMStorageContextImpl* GetDOMStorageContext() OVERRIDE; virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE; - virtual void AsyncClearDataForOrigin( - uint32 storage_mask, + + virtual void ClearDataForOrigin( + uint32 remove_mask, + uint32 quota_storage_remove_mask, const GURL& storage_origin, net::URLRequestContextGetter* request_context_getter) OVERRIDE; - virtual void AsyncClearData(uint32 storage_mask) OVERRIDE; - virtual void AsyncClearDataBetween( - uint32 storage_mask, - const base::Time& begin, - const base::Time& end, - const base::Closure& callback) OVERRIDE; + virtual void ClearDataForUnboundedRange( + uint32 remove_mask, + 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::Closure& callback) OVERRIDE; WebRTCIdentityStore* GetWebRTCIdentityStore(); + struct DataDeletionHelper; + struct QuotaManagedDataDeletionHelper; + private: friend class StoragePartitionImplMap; FRIEND_TEST_ALL_PREFIXES(StoragePartitionShaderClearTest, ClearShaderCache); @@ -58,6 +65,10 @@ 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, @@ -68,6 +79,14 @@ class StoragePartitionImpl : public StoragePartition { IndexedDBContextImpl* indexed_db_context, scoped_ptr webrtc_identity_store); + void ClearDataImpl(uint32 remove_mask, + uint32 quota_storage_remove_mask, + const GURL& remove_origin, + net::URLRequestContextGetter* rq_context, + const base::Time begin, + const base::Time end, + const base::Closure& callback); + // Used by StoragePartitionImplMap. // // TODO(ajwong): These should be taken in the constructor and in Create() but -- cgit v1.1