summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-20 04:02:45 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-20 04:02:45 +0000
commitfdae8bf7224a3f6771ec937abe0e5f1dd36387fc (patch)
tree7fa79eb7105b388b0df79f027b23d6ec9b6bae50
parentd99867df5eca85690b93e574d98b297f0dd818ce (diff)
downloadchromium_src-fdae8bf7224a3f6771ec937abe0e5f1dd36387fc.zip
chromium_src-fdae8bf7224a3f6771ec937abe0e5f1dd36387fc.tar.gz
chromium_src-fdae8bf7224a3f6771ec937abe0e5f1dd36387fc.tar.bz2
Stop using URLRequest::AppendBytesToUpload from src/content
AppendBytesToUpload will be soon deleted. It can be easily replaced with set_upload() BUG=161708 TEST=git try Review URL: https://chromiumcodereview.appspot.com/11416066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168717 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/download/download_manager_impl.cc9
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_unittest.cc4
2 files changed, 9 insertions, 4 deletions
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index f17da88..6099eca 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -60,9 +60,12 @@ void BeginDownload(scoped_ptr<DownloadUrlParameters> params) {
request.get(), params->referrer().policy);
request->set_load_flags(request->load_flags() | params->load_flags());
request->set_method(params->method());
- if (!params->post_body().empty())
- request->AppendBytesToUpload(params->post_body().data(),
- params->post_body().size());
+ if (!params->post_body().empty()) {
+ scoped_refptr<net::UploadData> upload_data(new net::UploadData());
+ upload_data->AppendBytes(params->post_body().data(),
+ params->post_body().size());
+ request->set_upload(upload_data);
+ }
if (params->post_id() >= 0) {
// The POST in this case does not have an actual body, and only works
// when retrieving data from cache. This is done because we don't want
diff --git a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
index 513e140..437b611 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -1291,7 +1291,9 @@ TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) {
std::string upload_content;
upload_content.resize(33);
std::fill(upload_content.begin(), upload_content.end(), 'x');
- req.AppendBytesToUpload(upload_content.data(), upload_content.size());
+ scoped_refptr<net::UploadData> upload_data(new net::UploadData());
+ upload_data->AppendBytes(upload_content.data(), upload_content.size());
+ req.set_upload(upload_data);
// Since the upload throttling is disabled, this has no effect on the cost.
EXPECT_EQ(4436,