summaryrefslogtreecommitdiffstats
path: root/net/test
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 19:50:40 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 19:50:40 +0000
commit0736d9e6236381ca378e108fd4ba9d794c247a6e (patch)
tree0984ff7e6927fa95867cc77f48f88f2163b71012 /net/test
parentbf63a0c1e70c8973d24c9e2613e2e3adbb7f6b4b (diff)
downloadchromium_src-0736d9e6236381ca378e108fd4ba9d794c247a6e.zip
chromium_src-0736d9e6236381ca378e108fd4ba9d794c247a6e.tar.gz
chromium_src-0736d9e6236381ca378e108fd4ba9d794c247a6e.tar.bz2
net: Move ownership of UploadDataStream from URLRequestHttpJob to URLRequest
URLRequest creates and owns UploadDataStream. URLRequest::get_upload_mutable and URLRequest::AppendBytesToUpload are removed because they can modify UploadData after UploadDataStream is created. Return type of URLRequest::get_upload is changed from UploadData to UploadDataStream. A number of methods are added to UploadElementReader and its subclasses to support URLRequestAutomationJob and some other users. BUG=156574 TEST=git try TBR=jam@chromium.org (for chrome/browser/automation, already reviewed by ananta@chromium.org) Review URL: https://chromiumcodereview.appspot.com/11419034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r--net/test/spawner_communicator.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/test/spawner_communicator.cc b/net/test/spawner_communicator.cc
index 3a5874a..c94a4c2 100644
--- a/net/test/spawner_communicator.cc
+++ b/net/test/spawner_communicator.cc
@@ -14,6 +14,7 @@
#include "build/build_config.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_util.h"
+#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_test_util.h"
@@ -183,7 +184,9 @@ void SpawnerCommunicator::SendCommandAndWaitForResultOnIOThread(
cur_request_->set_method("GET");
} else {
cur_request_->set_method("POST");
- cur_request_->AppendBytesToUpload(post_data.c_str(), post_data.size());
+ scoped_refptr<UploadData> upload_data(new UploadData());
+ upload_data->AppendBytes(post_data.c_str(), post_data.size());
+ cur_request_->set_upload(upload_data);
net::HttpRequestHeaders headers;
headers.SetHeader(net::HttpRequestHeaders::kContentType,
"application/json");