diff options
| author | Grace Kloba <klobag@google.com> | 2009-11-09 13:44:38 -0800 |
|---|---|---|
| committer | Grace Kloba <klobag@google.com> | 2009-11-09 13:44:38 -0800 |
| commit | 13849e573d5c1d04724e37d543bd5b95f7445d8a (patch) | |
| tree | 8fc5af1e4e951056eab5e51913cdc8d21d65797f /WebKit | |
| parent | 1e3557295c152b901e406d0dc6e810f033d8c4db (diff) | |
| parent | ef7b176b34c6a1fe082a87dd17523e47737c1e19 (diff) | |
| download | external_webkit-13849e573d5c1d04724e37d543bd5b95f7445d8a.zip external_webkit-13849e573d5c1d04724e37d543bd5b95f7445d8a.tar.gz external_webkit-13849e573d5c1d04724e37d543bd5b95f7445d8a.tar.bz2 | |
resolved conflicts for merge of ef7b176b to master
Diffstat (limited to 'WebKit')
| -rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 11 | ||||
| -rw-r--r-- | WebKit/android/jni/WebCoreResourceLoader.cpp | 6 | ||||
| -rw-r--r-- | WebKit/android/jni/WebCoreResourceLoader.h | 2 | ||||
| -rw-r--r-- | WebKit/android/jni/WebHistory.cpp | 16 |
4 files changed, 26 insertions, 9 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index d1b2b67..7d46358 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -28,6 +28,7 @@ #include <config.h> #include <wtf/Platform.h> +#include <wtf/CurrentTime.h> #include "android_graphics.h" #include "Arena.h" @@ -169,7 +170,7 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* mJavaFrame->mObj = env->NewWeakGlobalRef(obj); mJavaFrame->mHistoryList = env->NewWeakGlobalRef(historyList); mJavaFrame->mStartLoadingResource = env->GetMethodID(clazz, "startLoadingResource", - "(ILjava/lang/String;Ljava/lang/String;Ljava/util/HashMap;[BIZ)Landroid/webkit/LoadListener;"); + "(ILjava/lang/String;Ljava/lang/String;Ljava/util/HashMap;[BJIZ)Landroid/webkit/LoadListener;"); mJavaFrame->mLoadStarted = env->GetMethodID(clazz, "loadStarted", "(Ljava/lang/String;Landroid/graphics/Bitmap;IZ)V"); mJavaFrame->mTransitionToCommitted = env->GetMethodID(clazz, "transitionToCommitted", @@ -438,7 +439,7 @@ WebFrame::startLoadingResource(WebCore::ResourceHandle* loader, jobject jLoadListener = env->CallObjectMethod(obj.get(), mJavaFrame->mStartLoadingResource, (int)loader, jUrlStr, jMethodStr, jHeaderMap, - jPostDataStr, cacheMode, synchronous); + jPostDataStr, formdata ? formdata->identifier(): 0, cacheMode, synchronous); env->DeleteLocalRef(jUrlStr); env->DeleteLocalRef(jMethodStr); @@ -946,7 +947,11 @@ static void PostUrl(JNIEnv *env, jobject obj, jstring url, jbyteArray postData) if (postData) { jsize size = env->GetArrayLength(postData); jbyte* bytes = env->GetByteArrayElements(postData, NULL); - request.setHTTPBody(WebCore::FormData::create((const void*)bytes, size)); + RefPtr<FormData> formData = FormData::create((const void*)bytes, size); + // the identifier uses the same logic as generateFormDataIdentifier() in + // HTMLFormElement.cpp + formData->setIdentifier(static_cast<int64_t>(WTF::currentTime() * 1000000.0)); + request.setHTTPBody(formData); env->ReleaseByteArrayElements(postData, bytes, 0); } diff --git a/WebKit/android/jni/WebCoreResourceLoader.cpp b/WebKit/android/jni/WebCoreResourceLoader.cpp index 1b40eb6..0891323 100644 --- a/WebKit/android/jni/WebCoreResourceLoader.cpp +++ b/WebKit/android/jni/WebCoreResourceLoader.cpp @@ -100,14 +100,14 @@ void WebCoreResourceLoader::downloadFile() * the cache. This may be slow, but is only used during a navigation to * a POST response. */ -bool WebCoreResourceLoader::willLoadFromCache(const WebCore::KURL& url) +bool WebCoreResourceLoader::willLoadFromCache(const WebCore::KURL& url, int64_t identifier) { JNIEnv* env = JSC::Bindings::getJNIEnv(); WebCore::String urlStr = url.string(); jstring jUrlStr = env->NewString(urlStr.characters(), urlStr.length()); jclass resourceLoader = env->FindClass("android/webkit/LoadListener"); bool val = env->CallStaticBooleanMethod(resourceLoader, - gResourceLoader.mWillLoadFromCacheMethodID, jUrlStr); + gResourceLoader.mWillLoadFromCacheMethodID, jUrlStr, identifier); checkException(env); env->DeleteLocalRef(jUrlStr); @@ -318,7 +318,7 @@ int register_resource_loader(JNIEnv* env) "Could not find method downloadFile on LoadListener"); gResourceLoader.mWillLoadFromCacheMethodID = - env->GetStaticMethodID(resourceLoader, "willLoadFromCache", "(Ljava/lang/String;)Z"); + env->GetStaticMethodID(resourceLoader, "willLoadFromCache", "(Ljava/lang/String;J)Z"); LOG_FATAL_IF(gResourceLoader.mWillLoadFromCacheMethodID == NULL, "Could not find static method willLoadFromCache on LoadListener"); diff --git a/WebKit/android/jni/WebCoreResourceLoader.h b/WebKit/android/jni/WebCoreResourceLoader.h index 60c0d0e..7ea1107 100644 --- a/WebKit/android/jni/WebCoreResourceLoader.h +++ b/WebKit/android/jni/WebCoreResourceLoader.h @@ -53,7 +53,7 @@ public: /** * Call to java to find out if this URL is in the cache */ - static bool willLoadFromCache(const WebCore::KURL& url); + static bool willLoadFromCache(const WebCore::KURL& url, int64_t identifier); // Native jni functions static void SetResponseHeader(JNIEnv*, jobject, jint, jstring, jstring); diff --git a/WebKit/android/jni/WebHistory.cpp b/WebKit/android/jni/WebHistory.cpp index 2193d06..4a7c84e 100644 --- a/WebKit/android/jni/WebHistory.cpp +++ b/WebKit/android/jni/WebHistory.cpp @@ -420,9 +420,12 @@ static void write_item(WTF::Vector<char>& v, WebCore::HistoryItem* item) // Form data const WebCore::FormData* formData = item->formData(); - if (formData) + if (formData) { write_string(v, formData->flattenToString()); - else + // save the identifier as it is not included in the flatten data + int64_t id = formData->identifier(); + v.append((char*)&id, sizeof(int64_t)); + } else write_string(v, WebCore::String()); // Empty constructor does not allocate a buffer. // Target @@ -573,6 +576,15 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, else return false; data += l; + // Read the identifier + { + int64_t id; + int size = (int)sizeof(int64_t); + memcpy(&id, data, size); + data += size; + if (id) + formData->setIdentifier(id); + } } if (end - data < sizeofUnsigned) return false; |
