diff options
author | Grace Kloba <klobag@google.com> | 2009-11-24 14:22:22 -0800 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2009-12-02 11:13:36 -0800 |
commit | 8ec4217018562da37ecf4144e582fa848b807263 (patch) | |
tree | e917a4c71fff6f8c4d065c130ba5bc1486d64e60 /WebKit/android/jni/WebSettings.cpp | |
parent | 73b03f71b87666e532e997c6bcd3eb6a4fc3228d (diff) | |
download | external_webkit-8ec4217018562da37ecf4144e582fa848b807263.zip external_webkit-8ec4217018562da37ecf4144e582fa848b807263.tar.gz external_webkit-8ec4217018562da37ecf4144e582fa848b807263.tar.bz2 |
Enable WebKit page cache through WebSettings.
Add setXX() for the meta data in Settings.
Add CachedFramePlatformDataAndroid to preserve the
state for the cachedFrame.
http://b/issue?id=2284168
Diffstat (limited to 'WebKit/android/jni/WebSettings.cpp')
-rw-r--r-- | WebKit/android/jni/WebSettings.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp index 9892ad6..00fec85 100644 --- a/WebKit/android/jni/WebSettings.cpp +++ b/WebKit/android/jni/WebSettings.cpp @@ -38,6 +38,7 @@ #include "Geolocation.h" #include "GeolocationPermissions.h" #include "Page.h" +#include "PageCache.h" #include "RenderTable.h" #include "Settings.h" #include "WebCoreFrameBridge.h" @@ -110,6 +111,7 @@ struct FieldIds { mSupportMultipleWindows = env->GetFieldID(clazz, "mSupportMultipleWindows", "Z"); mShrinksStandaloneImagesToFit = env->GetFieldID(clazz, "mShrinksStandaloneImagesToFit", "Z"); mUseDoubleTree = env->GetFieldID(clazz, "mUseDoubleTree", "Z"); + mPageCacheCapacity = env->GetFieldID(clazz, "mPageCacheCapacity", "I"); LOG_ASSERT(mLayoutAlgorithm, "Could not find field mLayoutAlgorithm"); LOG_ASSERT(mTextSize, "Could not find field mTextSize"); @@ -145,6 +147,7 @@ struct FieldIds { LOG_ASSERT(mSupportMultipleWindows, "Could not find field mSupportMultipleWindows"); LOG_ASSERT(mShrinksStandaloneImagesToFit, "Could not find field mShrinksStandaloneImagesToFit"); LOG_ASSERT(mUseDoubleTree, "Could not find field mUseDoubleTree"); + LOG_ASSERT(mPageCacheCapacity, "Could not find field mPageCacheCapacity"); jclass c = env->FindClass("java/lang/Enum"); LOG_ASSERT(c, "Could not find Enum class!"); @@ -189,6 +192,7 @@ struct FieldIds { jfieldID mSupportMultipleWindows; jfieldID mShrinksStandaloneImagesToFit; jfieldID mUseDoubleTree; + jfieldID mPageCacheCapacity; // Ordinal() method and value field for enums jmethodID mOrdinal; jfieldID mTextSizeValue; @@ -364,6 +368,13 @@ public: GeolocationPermissions::setDatabasePath(to_string(env,str)); WebCore::Geolocation::setDatabasePath(to_string(env,str)); } + + size = env->GetIntField(obj, gFieldIds->mPageCacheCapacity); + if (size > 0) { + s->setUsesPageCache(true); + WebCore::pageCache()->setCapacity(size); + } else + s->setUsesPageCache(false); } }; |