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

Unified Diff: webkit/glue/glue_serialize.cc

Issue 594036: Support sending a sliced file in chromium.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 | « net/url_request/url_request.cc ('k') | webkit/glue/glue_serialize_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/glue_serialize.cc
===================================================================
--- webkit/glue/glue_serialize.cc (revision 42417)
+++ webkit/glue/glue_serialize.cc (working copy)
@@ -19,6 +19,7 @@
#include "webkit/glue/webkit_glue.h"
using WebKit::WebData;
+using WebKit::WebFileInfo;
using WebKit::WebHistoryItem;
using WebKit::WebHTTPBody;
using WebKit::WebPoint;
@@ -53,12 +54,13 @@
// 5: Adds support for empty FormData
// 6: Adds support for documentSequenceNumbers
// 7: Adds support for stateObject
+// 8: Adds support for file range and modification time
// 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 = 7;
+int kVersion = 8;
// A bunch of convenience functions to read/write to SerializeObjects.
// The serializers assume the input data is in the correct format and so does
@@ -230,6 +232,9 @@
obj);
} else {
WriteString(element.filePath, obj);
+ WriteInteger64(element.fileStart, obj);
+ WriteInteger64(element.fileLength, obj);
+ WriteReal(element.fileInfo.modificationTime, obj);
}
}
WriteInteger64(http_body.identifier(), obj);
@@ -257,7 +262,16 @@
if (length >= 0)
http_body.appendData(WebData(static_cast<const char*>(data), length));
} else {
- http_body.appendFile(ReadString(obj));
+ WebString file_path = ReadString(obj);
+ long long file_start = 0;
+ long long file_length = -1;
+ WebFileInfo file_info;
+ if (obj->version >= 8) {
+ file_start = ReadInteger64(obj);
+ file_length = ReadInteger64(obj);
+ file_info.modificationTime = ReadReal(obj);
+ }
+ http_body.appendFileRange(file_path, file_start, file_length, file_info);
}
}
if (obj->version >= 4)
« no previous file with comments | « net/url_request/url_request.cc ('k') | webkit/glue/glue_serialize_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698