| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 5 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
| 10 #include "android_webview/browser/aw_content_browser_client.h" | 10 #include "android_webview/browser/aw_content_browser_client.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return quota_manager; | 200 return quota_manager; |
| 201 } | 201 } |
| 202 | 202 |
| 203 void AwQuotaManagerBridgeImpl::DeleteAllData(JNIEnv* env, jobject object) { | 203 void AwQuotaManagerBridgeImpl::DeleteAllData(JNIEnv* env, jobject object) { |
| 204 RunOnUIThread(base::Bind(&AwQuotaManagerBridgeImpl::DeleteAllDataOnUiThread, | 204 RunOnUIThread(base::Bind(&AwQuotaManagerBridgeImpl::DeleteAllDataOnUiThread, |
| 205 this)); | 205 this)); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void AwQuotaManagerBridgeImpl::DeleteAllDataOnUiThread() { | 208 void AwQuotaManagerBridgeImpl::DeleteAllDataOnUiThread() { |
| 209 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 209 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 210 GetStoragePartition()->ClearDataForUnboundedRange( | 210 GetStoragePartition()->ClearData( |
| 211 // Clear all web storage data except cookies. | 211 // Clear all web storage data except cookies. |
| 212 StoragePartition::REMOVE_DATA_MASK_APPCACHE | | 212 StoragePartition::REMOVE_DATA_MASK_APPCACHE | |
| 213 StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | | 213 StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | |
| 214 StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | | 214 StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | |
| 215 StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE | | 215 StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE | |
| 216 StoragePartition::REMOVE_DATA_MASK_WEBSQL, | 216 StoragePartition::REMOVE_DATA_MASK_WEBSQL, |
| 217 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY); | 217 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY, |
| 218 NULL, StoragePartition::OriginMatcherFunction(), |
| 219 base::Time(), base::Time::Max(), base::Bind(&base::DoNothing)); |
| 218 } | 220 } |
| 219 | 221 |
| 220 void AwQuotaManagerBridgeImpl::DeleteOrigin( | 222 void AwQuotaManagerBridgeImpl::DeleteOrigin( |
| 221 JNIEnv* env, jobject object, jstring origin) { | 223 JNIEnv* env, jobject object, jstring origin) { |
| 222 base::string16 origin_string( | 224 base::string16 origin_string( |
| 223 base::android::ConvertJavaStringToUTF16(env, origin)); | 225 base::android::ConvertJavaStringToUTF16(env, origin)); |
| 224 RunOnUIThread(base::Bind(&AwQuotaManagerBridgeImpl::DeleteOriginOnUiThread, | 226 RunOnUIThread(base::Bind(&AwQuotaManagerBridgeImpl::DeleteOriginOnUiThread, |
| 225 this, | 227 this, |
| 226 origin_string)); | 228 origin_string)); |
| 227 } | 229 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 347 |
| 346 Java_AwQuotaManagerBridge_onGetUsageAndQuotaForOriginCallback( | 348 Java_AwQuotaManagerBridge_onGetUsageAndQuotaForOriginCallback( |
| 347 env, obj.obj(), jcallback_id, is_quota, usage, quota); | 349 env, obj.obj(), jcallback_id, is_quota, usage, quota); |
| 348 } | 350 } |
| 349 | 351 |
| 350 bool RegisterAwQuotaManagerBridge(JNIEnv* env) { | 352 bool RegisterAwQuotaManagerBridge(JNIEnv* env) { |
| 351 return RegisterNativesImpl(env) >= 0; | 353 return RegisterNativesImpl(env) >= 0; |
| 352 } | 354 } |
| 353 | 355 |
| 354 } // namespace android_webview | 356 } // namespace android_webview |
| OLD | NEW |