Chromium Code Reviews| Index: content/common/resource_dispatcher.cc |
| diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc |
| index 610d20c8f5822329dd5edb98ea527641b27b9d2a..5a643f39d3b1ba423aa6f031b431bfc3c68230bd 100644 |
| --- a/content/common/resource_dispatcher.cc |
| +++ b/content/common/resource_dispatcher.cc |
| @@ -20,12 +20,13 @@ |
| #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_type.h" |
| +#include "webkit/glue/resource_request_body.h" |
|
darin (slow to review)
2012/08/15 17:49:55
nit: sort
kinuko
2012/08/16 08:14:59
Done.
|
| using webkit_glue::ResourceLoaderBridge; |
| using webkit_glue::ResourceResponseInfo; |
| +using webkit_glue::ResourceRequestBody; |
|
darin (slow to review)
2012/08/15 17:49:55
nit: sort
kinuko
2012/08/16 08:14:59
Done.
|
| 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 |