summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@android.com>2012-09-04 14:59:39 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-09-04 14:59:39 -0700
commit1a6030e76fa5fa0c0a19aeb7d7a53070b9438ea6 (patch)
treec884546503f7155510f6ea53b06b53025075e9d0
parent5fe0a0bed6096da8fb7beef2708c36972d67b723 (diff)
parent8eb920de3073bded959828bd4933affe577e7730 (diff)
downloadexternal_webkit-1a6030e76fa5fa0c0a19aeb7d7a53070b9438ea6.zip
external_webkit-1a6030e76fa5fa0c0a19aeb7d7a53070b9438ea6.tar.gz
external_webkit-1a6030e76fa5fa0c0a19aeb7d7a53070b9438ea6.tar.bz2
Merge "Remove inconsistency between HistoryItem writing/reading"
-rw-r--r--Source/WebKit/android/jni/WebHistory.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/WebKit/android/jni/WebHistory.cpp b/Source/WebKit/android/jni/WebHistory.cpp
index b6972e4..6b71d0f 100644
--- a/Source/WebKit/android/jni/WebHistory.cpp
+++ b/Source/WebKit/android/jni/WebHistory.cpp
@@ -472,10 +472,13 @@ static void writeItem(WTF::Vector<char>& vector, WebCore::HistoryItem* item)
// Form data
const WebCore::FormData* formData = item->formData();
if (formData) {
- writeString(vector, formData->flattenToString());
- // save the identifier as it is not included in the flatten data
- int64_t id = formData->identifier();
- vector.append((char*)&id, sizeof(int64_t));
+ WTF::String flattenedFormData = formData->flattenToString();
+ writeString(vector, flattenedFormData);
+ if (!flattenedFormData.isEmpty()) {
+ // save the identifier as it is not included in the flatten data
+ int64_t id = formData->identifier();
+ vector.append((char*)&id, sizeof(int64_t));
+ }
} else
writeString(vector, WTF::String()); // Empty constructor does not allocate a buffer.