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

Side by Side Diff: trunk/src/cloud_print/service/service_state.cc

Issue 47563006: Revert 232802 "[Net] Assert that URLRequests with LOAD_IGNORE_LI..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cloud_print/service/service_state.h" 5 #include "cloud_print/service/service_state.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 post_body += "&Email=" + net::EscapeUrlEncodedData(email, true); 173 post_body += "&Email=" + net::EscapeUrlEncodedData(email, true);
174 post_body += "&Passwd=" + net::EscapeUrlEncodedData(password, true); 174 post_body += "&Passwd=" + net::EscapeUrlEncodedData(password, true);
175 post_body += "&source=" + net::EscapeUrlEncodedData("CP-Service", true); 175 post_body += "&source=" + net::EscapeUrlEncodedData("CP-Service", true);
176 post_body += "&service=" + net::EscapeUrlEncodedData(service, true); 176 post_body += "&service=" + net::EscapeUrlEncodedData(service, true);
177 177
178 net::URLRequest request( 178 net::URLRequest request(
179 url, net::DEFAULT_PRIORITY, &fetcher_delegate, context.get()); 179 url, net::DEFAULT_PRIORITY, &fetcher_delegate, context.get());
180 int load_flags = request.load_flags(); 180 int load_flags = request.load_flags();
181 load_flags = load_flags | net::LOAD_DO_NOT_SEND_COOKIES; 181 load_flags = load_flags | net::LOAD_DO_NOT_SEND_COOKIES;
182 load_flags = load_flags | net::LOAD_DO_NOT_SAVE_COOKIES; 182 load_flags = load_flags | net::LOAD_DO_NOT_SAVE_COOKIES;
183 request.SetLoadFlags(load_flags); 183 request.set_load_flags(load_flags);
184 184
185 scoped_ptr<net::UploadElementReader> reader( 185 scoped_ptr<net::UploadElementReader> reader(
186 net::UploadOwnedBytesElementReader::CreateWithString(post_body)); 186 net::UploadOwnedBytesElementReader::CreateWithString(post_body));
187 request.set_upload(make_scoped_ptr( 187 request.set_upload(make_scoped_ptr(
188 net::UploadDataStream::CreateWithReader(reader.Pass(), 0))); 188 net::UploadDataStream::CreateWithReader(reader.Pass(), 0)));
189 request.SetExtraRequestHeaderByName( 189 request.SetExtraRequestHeaderByName(
190 "Content-Type", "application/x-www-form-urlencoded", true); 190 "Content-Type", "application/x-www-form-urlencoded", true);
191 request.set_method("POST"); 191 request.set_method("POST");
192 request.Start(); 192 request.Start();
193 193
(...skipping 19 matching lines...) Expand all
213 const std::string& password, 213 const std::string& password,
214 const std::string& proxy_id) { 214 const std::string& proxy_id) {
215 robot_token_.clear(); 215 robot_token_.clear();
216 robot_email_.clear(); 216 robot_email_.clear();
217 email_ = email; 217 email_ = email;
218 proxy_id_ = proxy_id; 218 proxy_id_ = proxy_id;
219 auth_token_ = LoginToGoogle("cloudprint", email_, password); 219 auth_token_ = LoginToGoogle("cloudprint", email_, password);
220 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password); 220 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password);
221 return IsValid(); 221 return IsValid();
222 } 222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698