| Index: android_webview/native/state_serializer.cc
|
| diff --git a/android_webview/native/state_serializer.cc b/android_webview/native/state_serializer.cc
|
| index f4a628b39a70bf1023f80b24e00c3361f50016fe..457ea20cc0ab992277858a04e5535f2ddacd7bab 100644
|
| --- a/android_webview/native/state_serializer.cc
|
| +++ b/android_webview/native/state_serializer.cc
|
| @@ -35,7 +35,7 @@ namespace {
|
| // Sanity check value that we are restoring from a valid pickle.
|
| // This can potentially used as an actual serialization version number in the
|
| // future if we ever decide to support restoring from older versions.
|
| -const uint32 AW_STATE_VERSION = 20130814;
|
| +const uint32 AW_STATE_VERSION = 20131123;
|
|
|
| } // namespace
|
|
|
| @@ -177,6 +177,20 @@ bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry,
|
| if (!pickle->WriteString(entry.GetOriginalRequestURL().spec()))
|
| return false;
|
|
|
| + {
|
| + const char* data = NULL;
|
| + size_t size = 0;
|
| + scoped_refptr<base::RefCountedMemory> d = entry.GetDataForDataURL();
|
| + if (d.get()) {
|
| + data = reinterpret_cast<const char*>(d->front());
|
| + size = d->size();
|
| + }
|
| + // Even when |entry.GetDataForDataURL()| is NULL we still need to write a
|
| + // zero-length entry to ensure the fields all line up when read back in.
|
| + if (!pickle->WriteData(data, size))
|
| + return false;
|
| + }
|
| +
|
| if (!pickle->WriteString(entry.GetBaseURLForDataURL().spec()))
|
| return false;
|
|
|
| @@ -255,6 +269,18 @@ bool RestoreNavigationEntryFromPickle(PickleIterator* iterator,
|
| }
|
|
|
| {
|
| + const char* data;
|
| + int len;
|
| + if (!iterator->ReadData(&data, &len))
|
| + return false;
|
| + if (len > 0) {
|
| + scoped_refptr<base::RefCountedString> ref = new base::RefCountedString;
|
| + ref->data().assign(data, len);
|
| + entry->SetDataForDataURL(ref.get());
|
| + }
|
| + }
|
| +
|
| + {
|
| string base_url_for_data_url;
|
| if (!iterator->ReadString(&base_url_for_data_url))
|
| return false;
|
|
|