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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 void AwQuotaManagerBridgeImpl::DeleteAllData(JNIEnv* env, jobject object) { | 188 void AwQuotaManagerBridgeImpl::DeleteAllData(JNIEnv* env, jobject object) { |
189 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 189 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
190 GetStoragePartition()->ClearDataForUnboundedRange( | 190 GetStoragePartition()->ClearDataForUnboundedRange( |
191 // Clear all web storage data except cookies. | 191 // Clear all web storage data except cookies. |
192 StoragePartition::REMOVE_DATA_MASK_APPCACHE | | 192 StoragePartition::REMOVE_DATA_MASK_APPCACHE | |
193 StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | | 193 StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | |
194 StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | | 194 StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | |
195 StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE | | 195 StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE | |
196 StoragePartition::REMOVE_DATA_MASK_WEBSQL, | 196 StoragePartition::REMOVE_DATA_MASK_WEBSQL, |
197 StoragePartition::kQuotaManagedTemporaryStorage); | 197 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY); |
198 } | 198 } |
199 | 199 |
200 void AwQuotaManagerBridgeImpl::DeleteOrigin( | 200 void AwQuotaManagerBridgeImpl::DeleteOrigin( |
201 JNIEnv* env, jobject object, jstring origin) { | 201 JNIEnv* env, jobject object, jstring origin) { |
202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
203 StoragePartition* storage_partition = GetStoragePartition(); | 203 StoragePartition* storage_partition = GetStoragePartition(); |
204 storage_partition->ClearDataForOrigin( | 204 storage_partition->ClearDataForOrigin( |
205 // All (temporary) QuotaClient types. | 205 // All (temporary) QuotaClient types. |
206 StoragePartition::REMOVE_DATA_MASK_APPCACHE | | 206 StoragePartition::REMOVE_DATA_MASK_APPCACHE | |
207 StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | | 207 StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS | |
208 StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | | 208 StoragePartition::REMOVE_DATA_MASK_INDEXEDDB | |
209 StoragePartition::REMOVE_DATA_MASK_WEBSQL, | 209 StoragePartition::REMOVE_DATA_MASK_WEBSQL, |
210 StoragePartition::kQuotaManagedTemporaryStorage, | 210 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY, |
211 GURL(base::android::ConvertJavaStringToUTF16(env, origin)), | 211 GURL(base::android::ConvertJavaStringToUTF16(env, origin)), |
212 storage_partition->GetURLRequestContext()); | 212 storage_partition->GetURLRequestContext()); |
213 } | 213 } |
214 | 214 |
215 void AwQuotaManagerBridgeImpl::GetOrigins( | 215 void AwQuotaManagerBridgeImpl::GetOrigins( |
216 JNIEnv* env, jobject object, jint callback_id) { | 216 JNIEnv* env, jobject object, jint callback_id) { |
217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
218 | 218 |
219 const GetOriginsCallback ui_callback = base::Bind( | 219 const GetOriginsCallback ui_callback = base::Bind( |
220 &AwQuotaManagerBridgeImpl::GetOriginsCallbackImpl, | 220 &AwQuotaManagerBridgeImpl::GetOriginsCallbackImpl, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 296 |
297 Java_AwQuotaManagerBridge_onGetUsageAndQuotaForOriginCallback( | 297 Java_AwQuotaManagerBridge_onGetUsageAndQuotaForOriginCallback( |
298 env, obj.obj(), jcallback_id, is_quota, usage, quota); | 298 env, obj.obj(), jcallback_id, is_quota, usage, quota); |
299 } | 299 } |
300 | 300 |
301 bool RegisterAwQuotaManagerBridge(JNIEnv* env) { | 301 bool RegisterAwQuotaManagerBridge(JNIEnv* env) { |
302 return RegisterNativesImpl(env) >= 0; | 302 return RegisterNativesImpl(env) >= 0; |
303 } | 303 } |
304 | 304 |
305 } // namespace android_webview | 305 } // namespace android_webview |
OLD | NEW |