diff options
author | John Reck <jreck@android.com> | 2012-09-04 15:57:32 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-04 15:57:32 -0700 |
commit | 43e94fa8daa7eaaece0da98e14809891b3fd2b4c (patch) | |
tree | 2c49e576438322b68869d846a387e6ca77be6497 | |
parent | 4d33d9fbe70f0b56bd2c9bf8e6269ae21b4a5521 (diff) | |
parent | 1a6030e76fa5fa0c0a19aeb7d7a53070b9438ea6 (diff) | |
download | external_webkit-43e94fa8daa7eaaece0da98e14809891b3fd2b4c.zip external_webkit-43e94fa8daa7eaaece0da98e14809891b3fd2b4c.tar.gz external_webkit-43e94fa8daa7eaaece0da98e14809891b3fd2b4c.tar.bz2 |
am 1a6030e7: Merge "Remove inconsistency between HistoryItem writing/reading"
* commit '1a6030e76fa5fa0c0a19aeb7d7a53070b9438ea6':
Remove inconsistency between HistoryItem writing/reading
-rw-r--r-- | Source/WebKit/android/jni/WebHistory.cpp | 11 |
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. |