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

Unified Diff: cloud_print/service/service_state.cc

Issue 407093011: Allow URLRequests from one context to have different NetworkDelegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new tests Created 6 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
Index: cloud_print/service/service_state.cc
diff --git a/cloud_print/service/service_state.cc b/cloud_print/service/service_state.cc
index 0894e20516d599fc793c43e6453965de80527c45..811c2c12c933382e9b85e6d4b5ae2cfa0745b48b 100644
--- a/cloud_print/service/service_state.cc
+++ b/cloud_print/service/service_state.cc
@@ -175,21 +175,21 @@ std::string ServiceState::LoginToGoogle(const std::string& service,
post_body += "&source=" + net::EscapeUrlEncodedData("CP-Service", true);
post_body += "&service=" + net::EscapeUrlEncodedData(service, true);
- net::URLRequest request(
- url, net::DEFAULT_PRIORITY, &fetcher_delegate, context.get());
- int load_flags = request.load_flags();
+ scoped_ptr<net::URLRequest> request(context->CreateRequest(
+ url, net::DEFAULT_PRIORITY, &fetcher_delegate, NULL));
+ int load_flags = request->load_flags();
load_flags = load_flags | net::LOAD_DO_NOT_SEND_COOKIES;
load_flags = load_flags | net::LOAD_DO_NOT_SAVE_COOKIES;
- request.SetLoadFlags(load_flags);
+ request->SetLoadFlags(load_flags);
scoped_ptr<net::UploadElementReader> reader(
net::UploadOwnedBytesElementReader::CreateWithString(post_body));
- request.set_upload(make_scoped_ptr(
+ request->set_upload(make_scoped_ptr(
net::UploadDataStream::CreateWithReader(reader.Pass(), 0)));
- request.SetExtraRequestHeaderByName(
+ request->SetExtraRequestHeaderByName(
"Content-Type", "application/x-www-form-urlencoded", true);
- request.set_method("POST");
- request.Start();
+ request->set_method("POST");
+ request->Start();
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698