diff options
author | Andrei Popescu <andreip@google.com> | 2009-07-22 16:52:03 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-07-22 16:52:03 +0100 |
commit | dd7fab39a0afb776e22686558313e31e2bf0fd64 (patch) | |
tree | 67fe985d50f6054cc85f61c8e52cf7b7f1cbd830 /WebKit | |
parent | 769e21eaac67b6b46de0e2cafc31f61fb990179e (diff) | |
download | external_webkit-dd7fab39a0afb776e22686558313e31e2bf0fd64.zip external_webkit-dd7fab39a0afb776e22686558313e31e2bf0fd64.tar.gz external_webkit-dd7fab39a0afb776e22686558313e31e2bf0fd64.tar.bz2 |
Enforce app cache maximum size
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/jni/WebSettings.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp index 7d2b12d..73ebf63 100644 --- a/WebKit/android/jni/WebSettings.cpp +++ b/WebKit/android/jni/WebSettings.cpp @@ -92,6 +92,7 @@ struct FieldIds { #if ENABLE(OFFLINE_WEB_APPLICATIONS) mAppCacheEnabled = env->GetFieldID(clazz, "mAppCacheEnabled", "Z"); mAppCachePath = env->GetFieldID(clazz, "mAppCachePath", "Ljava/lang/String;"); + mAppCacheMaxSize = env->GetFieldID(clazz, "mAppCacheMaxSize", "J"); #endif mJavaScriptCanOpenWindowsAutomatically = env->GetFieldID(clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z"); @@ -123,6 +124,7 @@ struct FieldIds { #if ENABLE(OFFLINE_WEB_APPLICATIONS) LOG_ASSERT(mAppCacheEnabled, "Could not find field mAppCacheEnabled"); LOG_ASSERT(mAppCachePath, "Could not find field mAppCachePath"); + LOG_ASSERT(mAppCacheMaxSize, "Could not find field mAppCacheMaxSize"); #endif LOG_ASSERT(mJavaScriptCanOpenWindowsAutomatically, "Could not find field mJavaScriptCanOpenWindowsAutomatically"); @@ -164,6 +166,7 @@ struct FieldIds { #if ENABLE(OFFLINE_WEB_APPLICATIONS) jfieldID mAppCacheEnabled; jfieldID mAppCachePath; + jfieldID mAppCacheMaxSize; #endif jfieldID mJavaScriptCanOpenWindowsAutomatically; jfieldID mUseWideViewport; @@ -299,6 +302,8 @@ public: WebCore::cacheStorage().setCacheDirectory(path); } } + jlong maxsize = env->GetIntField(obj, gFieldIds->mAppCacheMaxSize); + WebCore::cacheStorage().setMaximumSize(maxsize); #endif flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptCanOpenWindowsAutomatically); s->setJavaScriptCanOpenWindowsAutomatically(flag); |