diff options
author | Ben Murdoch <benm@google.com> | 2009-08-25 19:31:29 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-08-26 12:43:18 +0100 |
commit | 4dc5706791f76d14261e27a58f50fcf305fcf1b0 (patch) | |
tree | 4c4cb686841fc0ac421a7e9680dbd711db957411 | |
parent | 4529c92defc2461a911526fb70c6abf72076edb8 (diff) | |
download | external_webkit-4dc5706791f76d14261e27a58f50fcf305fcf1b0.zip external_webkit-4dc5706791f76d14261e27a58f50fcf305fcf1b0.tar.gz external_webkit-4dc5706791f76d14261e27a58f50fcf305fcf1b0.tar.bz2 |
Pass the estimated size of new databases to the Java implementation so that that figure can be used to establish an initial quota for origins.
Change-Id:Ife96fb4fecee1974a36ceb1432a75f3ef164084b
-rw-r--r-- | WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp | 5 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 6 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index 30b208b..6dc7faf 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -291,7 +291,10 @@ void ChromeClientAndroid::exceededDatabaseQuota(Frame* frame, const String& name if (WebCore::DatabaseTracker::tracker().hasEntryForOrigin(origin)) { currentQuota = WebCore::DatabaseTracker::tracker().quotaForOrigin(origin); } - android::WebViewCore::getWebViewCore(frame->view())->exceededDatabaseQuota(frame->document()->documentURI(), name, currentQuota); + + unsigned long long estimatedSize = WebCore::DatabaseTracker::tracker().detailsForNameAndOrigin(name, origin).expectedUsage(); + + android::WebViewCore::getWebViewCore(frame->view())->exceededDatabaseQuota(frame->document()->documentURI(), name, currentQuota, estimatedSize); // We've sent notification to the browser so now wait for it to come back. m_quotaThreadLock.lock(); diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 7bc16f1..0a205da 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -253,7 +253,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_restoreScreenWidthScale = GetJMethod(env, clazz, "restoreScreenWidthScale", "(I)V"); m_javaGlue->m_needTouchEvents = GetJMethod(env, clazz, "needTouchEvents", "(Z)V"); m_javaGlue->m_requestKeyboard = GetJMethod(env, clazz, "requestKeyboard", "(Z)V"); - m_javaGlue->m_exceededDatabaseQuota = GetJMethod(env, clazz, "exceededDatabaseQuota", "(Ljava/lang/String;Ljava/lang/String;J)V"); + m_javaGlue->m_exceededDatabaseQuota = GetJMethod(env, clazz, "exceededDatabaseQuota", "(Ljava/lang/String;Ljava/lang/String;JJ)V"); m_javaGlue->m_reachedMaxAppCacheSize = GetJMethod(env, clazz, "reachedMaxAppCacheSize", "(J)V"); m_javaGlue->m_geolocationPermissionsShowPrompt = GetJMethod(env, clazz, "geolocationPermissionsShowPrompt", "(Ljava/lang/String;)V"); m_javaGlue->m_geolocationPermissionsHidePrompt = GetJMethod(env, clazz, "geolocationPermissionsHidePrompt", "()V"); @@ -2031,13 +2031,13 @@ void WebViewCore::jsAlert(const WebCore::String& url, const WebCore::String& tex checkException(env); } -void WebViewCore::exceededDatabaseQuota(const WebCore::String& url, const WebCore::String& databaseIdentifier, const unsigned long long currentQuota) +void WebViewCore::exceededDatabaseQuota(const WebCore::String& url, const WebCore::String& databaseIdentifier, const unsigned long long currentQuota, unsigned long long estimatedSize) { #if ENABLE(DATABASE) JNIEnv* env = JSC::Bindings::getJNIEnv(); jstring jDatabaseIdentifierStr = env->NewString((unsigned short *)databaseIdentifier.characters(), databaseIdentifier.length()); jstring jUrlStr = env->NewString((unsigned short *)url.characters(), url.length()); - env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_exceededDatabaseQuota, jUrlStr, jDatabaseIdentifierStr, currentQuota); + env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_exceededDatabaseQuota, jUrlStr, jDatabaseIdentifierStr, currentQuota, estimatedSize); env->DeleteLocalRef(jDatabaseIdentifierStr); env->DeleteLocalRef(jUrlStr); checkException(env); diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 697ed59..2c21a6f 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -201,11 +201,13 @@ namespace android { * @param url The URL of the page that caused the quota overflow * @param databaseIdentifier the id of the database that caused the * quota overflow. - * @param currentQuota The current quota for the origin. + * @param currentQuota The current quota for the origin + * @param estimatedSize The estimated size of the database */ void exceededDatabaseQuota(const WebCore::String& url, const WebCore::String& databaseIdentifier, - const unsigned long long currentQuota); + const unsigned long long currentQuota, + const unsigned long long estimatedSize); /** * Tell the Java side that the appcache has exceeded its max size. |