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

Unified Diff: webkit/glue/glue_serialize.cc

Issue 10828252: Support FileSystem URL in File object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 8 years, 4 months 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
« no previous file with comments | « webkit/blob/view_blob_internals_job.cc ('k') | webkit/glue/resource_request_body.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/glue_serialize.cc
diff --git a/webkit/glue/glue_serialize.cc b/webkit/glue/glue_serialize.cc
index 048bbdd63be70aa7d95b82cbfb13fbe0e2aa9a4c..c712d777af4233f562d12356b7fff6633ecd36e8 100644
--- a/webkit/glue/glue_serialize.cc
+++ b/webkit/glue/glue_serialize.cc
@@ -68,12 +68,13 @@ struct SerializeObject {
// 10: Adds support for blob
// 11: Adds support for pageScaleFactor
// 12: Adds support for hasPasswordData in HTTP body
+// 13: Adds support for URL (FileSystem URL)
// Should be const, but unit tests may modify it.
//
// NOTE: If the version is -1, then the pickle contains only a URL string.
// See CreateHistoryStateForURL.
//
-int kVersion = 12;
+int kVersion = 13;
// A bunch of convenience functions to read/write to SerializeObjects.
// The serializers assume the input data is in the correct format and so does
@@ -258,8 +259,13 @@ void WriteFormData(const WebHTTPBody& http_body, SerializeObject* obj) {
WriteInteger64(element.fileStart, obj);
WriteInteger64(element.fileLength, obj);
WriteReal(element.modificationTime, obj);
+ } else if (element.type == WebHTTPBody::Element::TypeURL) {
+ WriteGURL(element.url, obj);
+ WriteInteger64(element.fileStart, obj);
+ WriteInteger64(element.fileLength, obj);
+ WriteReal(element.modificationTime, obj);
} else {
- WriteGURL(element.blobURL, obj);
+ WriteGURL(element.url, obj);
}
}
WriteInteger64(http_body.identifier(), obj);
@@ -299,6 +305,16 @@ WebHTTPBody ReadFormData(const SerializeObject* obj) {
}
http_body.appendFileRange(file_path, file_start, file_length,
modification_time);
+ } else if (type == WebHTTPBody::Element::TypeURL) {
+ GURL url = ReadGURL(obj);
+ long long file_start = 0;
+ long long file_length = -1;
+ double modification_time = 0.0;
+ file_start = ReadInteger64(obj);
+ file_length = ReadInteger64(obj);
+ modification_time = ReadReal(obj);
+ http_body.appendURLRange(url, file_start, file_length,
+ modification_time);
} else if (obj->version >= 10) {
GURL blob_url = ReadGURL(obj);
http_body.appendBlob(blob_url);
« no previous file with comments | « webkit/blob/view_blob_internals_job.cc ('k') | webkit/glue/resource_request_body.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698