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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY, | 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()); | |
213 } | 212 } |
214 | 213 |
215 void AwQuotaManagerBridgeImpl::GetOrigins( | 214 void AwQuotaManagerBridgeImpl::GetOrigins( |
216 JNIEnv* env, jobject object, jint callback_id) { | 215 JNIEnv* env, jobject object, jint callback_id) { |
217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 216 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
218 | 217 |
219 const GetOriginsCallback ui_callback = base::Bind( | 218 const GetOriginsCallback ui_callback = base::Bind( |
220 &AwQuotaManagerBridgeImpl::GetOriginsCallbackImpl, | 219 &AwQuotaManagerBridgeImpl::GetOriginsCallbackImpl, |
221 weak_factory_.GetWeakPtr(), | 220 weak_factory_.GetWeakPtr(), |
222 callback_id); | 221 callback_id); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 295 |
297 Java_AwQuotaManagerBridge_onGetUsageAndQuotaForOriginCallback( | 296 Java_AwQuotaManagerBridge_onGetUsageAndQuotaForOriginCallback( |
298 env, obj.obj(), jcallback_id, is_quota, usage, quota); | 297 env, obj.obj(), jcallback_id, is_quota, usage, quota); |
299 } | 298 } |
300 | 299 |
301 bool RegisterAwQuotaManagerBridge(JNIEnv* env) { | 300 bool RegisterAwQuotaManagerBridge(JNIEnv* env) { |
302 return RegisterNativesImpl(env) >= 0; | 301 return RegisterNativesImpl(env) >= 0; |
303 } | 302 } |
304 | 303 |
305 } // namespace android_webview | 304 } // namespace android_webview |
OLD | NEW |