diff options
author | lazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 06:23:46 +0000 |
---|---|---|
committer | lazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 06:23:46 +0000 |
commit | fdf3e13c44fd319d3cc186ea46eebfb0eafe53ad (patch) | |
tree | b0453be082f8e30e557da7bd097b8fc189e014e9 /android_webview | |
parent | f7f61087146eff6339cb5a5ab35ae6ad486b30aa (diff) | |
download | chromium_src-fdf3e13c44fd319d3cc186ea46eebfb0eafe53ad.zip chromium_src-fdf3e13c44fd319d3cc186ea46eebfb0eafe53ad.tar.gz chromium_src-fdf3e13c44fd319d3cc186ea46eebfb0eafe53ad.tar.bz2 |
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
Diffstat (limited to 'android_webview')
-rw-r--r-- | android_webview/native/aw_quota_manager_bridge_impl.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/android_webview/native/aw_quota_manager_bridge_impl.cc b/android_webview/native/aw_quota_manager_bridge_impl.cc index 6427588..e9cb8ac 100644 --- a/android_webview/native/aw_quota_manager_bridge_impl.cc +++ b/android_webview/native/aw_quota_manager_bridge_impl.cc @@ -185,21 +185,28 @@ QuotaManager* AwQuotaManagerBridgeImpl::GetQuotaManager() const { return quota_manager; } -// Cannot directly call StoragePartition clear data methods because cookies are -// controlled separately. void AwQuotaManagerBridgeImpl::DeleteAllData(JNIEnv* env, jobject object) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - GetStoragePartition()->AsyncClearData( - StoragePartition::kQuotaManagedTemporaryStorage | - StoragePartition::kLocalDomStorage | - StoragePartition::kSessionDomStorage); + GetStoragePartition()->ClearDataForUnboundedRange( + // Clear all web storage data except cookies. + StoragePartition::REMOVE_DATA_MASK_APPCACHE | + StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | + StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | + StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE | + StoragePartition::REMOVE_DATA_MASK_WEBSQL, + StoragePartition::kQuotaManagedTemporaryStorage); } void AwQuotaManagerBridgeImpl::DeleteOrigin( JNIEnv* env, jobject object, jstring origin) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); StoragePartition* storage_partition = GetStoragePartition(); - storage_partition->AsyncClearDataForOrigin( + storage_partition->ClearDataForOrigin( + // All (temporary) QuotaClient types. + StoragePartition::REMOVE_DATA_MASK_APPCACHE | + StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | + StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | + StoragePartition::REMOVE_DATA_MASK_WEBSQL, StoragePartition::kQuotaManagedTemporaryStorage, GURL(base::android::ConvertJavaStringToUTF16(env, origin)), storage_partition->GetURLRequestContext()); |