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

Unified Diff: webkit/glue/weburlloader_impl.cc

Issue 10834289: Split net::UploadData into two: for IPC and for upload handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + moved ResolveBlobRef from webkit_blob to webkit_glue 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/glue/webkit_glue.gypi ('k') | webkit/tools/test_shell/simple_resource_loader_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/weburlloader_impl.cc
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index 104795dd1eed0e554ef5025249e6602c20cd0646..edc154247de5e23a90469e5ab46ffe1dc1ac8772 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -32,6 +32,7 @@
#include "webkit/glue/ftp_directory_listing_response_delegate.h"
#include "webkit/glue/multipart_response_delegate.h"
#include "webkit/glue/resource_loader_bridge.h"
+#include "webkit/glue/resource_request_body.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webkitplatformsupport_impl.h"
#include "webkit/glue/weburlrequest_extradata_impl.h"
@@ -444,22 +445,24 @@ void WebURLLoaderImpl::Context::Start(
const WebHTTPBody& httpBody = request.httpBody();
size_t i = 0;
WebHTTPBody::Element element;
+ scoped_refptr<ResourceRequestBody> request_body = new ResourceRequestBody;
while (httpBody.elementAt(i++, element)) {
switch (element.type) {
case WebHTTPBody::Element::TypeData:
if (!element.data.isEmpty()) {
// WebKit sometimes gives up empty data to append. These aren't
// necessary so we just optimize those out here.
- bridge_->AppendDataToUpload(
+ request_body->AppendBytes(
element.data.data(), static_cast<int>(element.data.size()));
}
break;
case WebHTTPBody::Element::TypeFile:
if (element.fileLength == -1) {
- bridge_->AppendFileToUpload(
- WebStringToFilePath(element.filePath));
+ request_body->AppendFileRange(
+ WebStringToFilePath(element.filePath),
+ 0, kuint64max, base::Time());
} else {
- bridge_->AppendFileRangeToUpload(
+ request_body->AppendFileRange(
WebStringToFilePath(element.filePath),
static_cast<uint64>(element.fileStart),
static_cast<uint64>(element.fileLength),
@@ -467,13 +470,14 @@ void WebURLLoaderImpl::Context::Start(
}
break;
case WebHTTPBody::Element::TypeBlob:
- bridge_->AppendBlobToUpload(GURL(element.blobURL));
+ request_body->AppendBlob(GURL(element.blobURL));
break;
default:
NOTREACHED();
}
}
- bridge_->SetUploadIdentifier(request.httpBody().identifier());
+ request_body->set_identifier(request.httpBody().identifier());
+ bridge_->SetRequestBody(request_body);
}
if (sync_load_response) {
« no previous file with comments | « webkit/glue/webkit_glue.gypi ('k') | webkit/tools/test_shell/simple_resource_loader_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698