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

Unified Diff: webkit/glue/glue_serialize.cc

Issue 3108042: Support sending BlobData to browser process. Also support sending UploadData... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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/webkit_blob.gypi ('k') | webkit/support/webkit_support.gyp » ('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 57697)
+++ webkit/glue/glue_serialize.cc (working copy)
@@ -15,6 +15,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebPoint.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSerializedScriptValue.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebVector.h"
#include "webkit/glue/webkit_glue.h"
@@ -56,12 +57,13 @@
// 7: Adds support for stateObject
// 8: Adds support for file range and modification time
// 9: Adds support for itemSequenceNumbers
+// 10: Adds support for blob
// 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 = 9;
+int kVersion = 10;
// A bunch of convenience functions to read/write to SerializeObjects.
// The serializers assume the input data is in the correct format and so does
@@ -234,11 +236,13 @@
if (element.type == WebHTTPBody::Element::TypeData) {
WriteData(element.data.data(), static_cast<int>(element.data.size()),
obj);
- } else {
+ } else if (element.type == WebHTTPBody::Element::TypeFile) {
WriteString(element.filePath, obj);
WriteInteger64(element.fileStart, obj);
WriteInteger64(element.fileLength, obj);
WriteReal(element.fileInfo.modificationTime, obj);
+ } else {
+ WriteGURL(element.blobURL, obj);
}
}
WriteInteger64(http_body.identifier(), obj);
@@ -265,7 +269,7 @@
ReadData(obj, &data, &length);
if (length >= 0)
http_body.appendData(WebData(static_cast<const char*>(data), length));
- } else {
+ } else if (type == WebHTTPBody::Element::TypeFile) {
WebString file_path = ReadString(obj);
long long file_start = 0;
long long file_length = -1;
@@ -276,6 +280,9 @@
file_info.modificationTime = ReadReal(obj);
}
http_body.appendFileRange(file_path, file_start, file_length, file_info);
+ } else if (obj->version >= 10) {
+ GURL blob_url = ReadGURL(obj);
+ http_body.appendBlob(blob_url);
}
}
if (obj->version >= 4)
« no previous file with comments | « webkit/blob/webkit_blob.gypi ('k') | webkit/support/webkit_support.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698