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

Unified Diff: cloud_print/service/service_state.cc

Issue 11439008: net: Change argument of URLRequest::set_upload from UploadData to UploadDataStream (Closed) Base URL: http://git.chromium.org/chromium/src.git@chunk
Patch Set: _ Created 8 years 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
Index: cloud_print/service/service_state.cc
diff --git a/cloud_print/service/service_state.cc b/cloud_print/service/service_state.cc
index 73b3966cad1e979c93f75e3ee0ed8c14dd27482a..2c6871ac64935e6e9d32919391af2b2fa4891285 100644
--- a/cloud_print/service/service_state.cc
+++ b/cloud_print/service/service_state.cc
@@ -13,7 +13,8 @@
#include "net/base/escape.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
-#include "net/base/upload_data.h"
+#include "net/base/upload_bytes_element_reader.h"
+#include "net/base/upload_data_stream.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
@@ -179,9 +180,10 @@ std::string ServiceState::LoginToGoogle(const std::string& service,
load_flags = load_flags | net::LOAD_DO_NOT_SAVE_COOKIES;
request.set_load_flags(load_flags);
- scoped_refptr<net::UploadData> upload_data(new net::UploadData());
- upload_data->AppendBytes(post_body.c_str(), post_body.size());
- request.set_upload(upload_data);
+ ScopedVector<net::UploadElementReader> element_readers;
+ element_readers.push_back(new net::UploadBytesElementReader(
+ post_body.c_str(), post_body.size()));
+ request.set_upload(new net::UploadDataStream(&element_readers, 0));
mmenke 2012/12/11 18:53:21 Egads...this function is ugly, though suppose that
hashimoto 2012/12/12 10:29:07 Should we switch to UploadOwnedBytesElementReader
mmenke 2012/12/12 19:26:41 I think that's a good idea.
hashimoto 2012/12/13 03:58:47 Done.
request.SetExtraRequestHeaderByName(
"Content-Type", "application/x-www-form-urlencoded", true);
request.set_method("POST");

Powered by Google App Engine
This is Rietveld 408576698