Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2142)

Unified Diff: android_webview/native/state_serializer.cc

Issue 84703003: Allow data URL > 2MB for loadDataWithBaseURL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tidy up Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3ed6c87105701a79421eb86f6c0a3ed1a49f2ed2 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,11 @@ bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry,
if (!pickle->WriteString(entry.GetOriginalRequestURL().spec()))
return false;
+ base::StringPiece data(base::RefCountedMemory::AsString(
+ entry.GetDataForDataURL()));
+ if (!pickle->WriteData(data.data(), data.size()))
+ return false;
+
if (!pickle->WriteString(entry.GetBaseURLForDataURL().spec()))
return false;
@@ -255,6 +260,14 @@ bool RestoreNavigationEntryFromPickle(PickleIterator* iterator,
}
{
+ scoped_refptr<base::RefCountedString> res = new base::RefCountedString;
+ if (!iterator->ReadString(&res->data()))
boliu 2013/11/26 17:15:15 Not pickle expert, but does can ReadString be matc
joth 2013/11/27 01:31:22 The internal implementation makes them compatible,
+ return false;
+ if (res->size())
+ entry->SetDataForDataURL(res.get());
+ }
+
+ {
string base_url_for_data_url;
if (!iterator->ReadString(&base_url_for_data_url))
return false;

Powered by Google App Engine
This is Rietveld 408576698