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

Unified Diff: content/common/resource_dispatcher.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 | « content/browser/renderer_host/resource_dispatcher_host_impl.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/resource_dispatcher.cc
diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc
index 610d20c8f5822329dd5edb98ea527641b27b9d2a..5fc90915c850f12f50dc0f00aa527befdf621957 100644
--- a/content/common/resource_dispatcher.cc
+++ b/content/common/resource_dispatcher.cc
@@ -20,11 +20,12 @@
#include "content/public/common/resource_response.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
-#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
+#include "webkit/glue/resource_request_body.h"
#include "webkit/glue/resource_type.h"
using webkit_glue::ResourceLoaderBridge;
+using webkit_glue::ResourceRequestBody;
using webkit_glue::ResourceResponseInfo;
namespace content {
@@ -47,14 +48,7 @@ class IPCResourceLoaderBridge : public ResourceLoaderBridge {
virtual ~IPCResourceLoaderBridge();
// ResourceLoaderBridge
- virtual void AppendDataToUpload(const char* data, int data_len);
- virtual void AppendFileRangeToUpload(
- const FilePath& path,
- uint64 offset,
- uint64 length,
- const base::Time& expected_modification_time);
- virtual void AppendBlobToUpload(const GURL& blob_url);
- virtual void SetUploadIdentifier(int64 identifier);
+ virtual void SetRequestBody(ResourceRequestBody* request_body);
virtual bool Start(Peer* peer);
virtual void Cancel();
virtual void SetDefersLoading(bool value);
@@ -142,44 +136,10 @@ IPCResourceLoaderBridge::~IPCResourceLoaderBridge() {
}
}
-void IPCResourceLoaderBridge::AppendDataToUpload(const char* data,
- int data_len) {
+void IPCResourceLoaderBridge::SetRequestBody(
+ ResourceRequestBody* request_body) {
DCHECK(request_id_ == -1) << "request already started";
-
- // don't bother appending empty data segments
- if (data_len == 0)
- return;
-
- if (!request_.upload_data)
- request_.upload_data = new net::UploadData();
- request_.upload_data->AppendBytes(data, data_len);
-}
-
-void IPCResourceLoaderBridge::AppendFileRangeToUpload(
- const FilePath& path, uint64 offset, uint64 length,
- const base::Time& expected_modification_time) {
- DCHECK(request_id_ == -1) << "request already started";
-
- if (!request_.upload_data)
- request_.upload_data = new net::UploadData();
- request_.upload_data->AppendFileRange(path, offset, length,
- expected_modification_time);
-}
-
-void IPCResourceLoaderBridge::AppendBlobToUpload(const GURL& blob_url) {
- DCHECK(request_id_ == -1) << "request already started";
-
- if (!request_.upload_data)
- request_.upload_data = new net::UploadData();
- request_.upload_data->AppendBlob(blob_url);
-}
-
-void IPCResourceLoaderBridge::SetUploadIdentifier(int64 identifier) {
- DCHECK(request_id_ == -1) << "request already started";
-
- if (!request_.upload_data)
- request_.upload_data = new net::UploadData();
- request_.upload_data->set_identifier(identifier);
+ request_.request_body = request_body;
}
// Writes a footer on the message and sends it
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_impl.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698