summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@android.com>2012-09-04 16:01:46 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-04 16:01:46 -0700
commit49a105247bbbb06b1f1ec85c542d4dd5b1b019c3 (patch)
tree35853d2cf42159149488efab68307458d6398bc0
parentabf93d76e0e37c2b42370f49dd171cde2096f92d (diff)
parent43e94fa8daa7eaaece0da98e14809891b3fd2b4c (diff)
downloadexternal_webkit-49a105247bbbb06b1f1ec85c542d4dd5b1b019c3.zip
external_webkit-49a105247bbbb06b1f1ec85c542d4dd5b1b019c3.tar.gz
external_webkit-49a105247bbbb06b1f1ec85c542d4dd5b1b019c3.tar.bz2
am 43e94fa8: am 1a6030e7: Merge "Remove inconsistency between HistoryItem writing/reading"
* commit '43e94fa8daa7eaaece0da98e14809891b3fd2b4c': 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 baafa00..c06244b 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.