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

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

Issue 1540213002: Switch to standard integer types in cloud_print/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « cloud_print/service/service_state.h ('k') | cloud_print/service/service_state_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h>
8
7 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
9 #include "base/logging.h" 11 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
11 #include "base/strings/string_split.h" 13 #include "base/strings/string_split.h"
12 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
14 #include "net/base/elements_upload_data_stream.h" 16 #include "net/base/elements_upload_data_stream.h"
15 #include "net/base/escape.h" 17 #include "net/base/escape.h"
16 #include "net/base/io_buffer.h" 18 #include "net/base/io_buffer.h"
(...skipping 11 matching lines...) Expand all
28 30
29 const char kEmailOptionName[] = "email"; 31 const char kEmailOptionName[] = "email";
30 const char kProxyIdOptionName[] = "proxy_id"; 32 const char kProxyIdOptionName[] = "proxy_id";
31 const char kRobotEmailOptionName[] = "robot_email"; 33 const char kRobotEmailOptionName[] = "robot_email";
32 const char kRobotTokenOptionName[] = "robot_refresh_token"; 34 const char kRobotTokenOptionName[] = "robot_refresh_token";
33 const char kAuthTokenOptionName[] = "auth_token"; 35 const char kAuthTokenOptionName[] = "auth_token";
34 const char kXmppAuthTokenOptionName[] = "xmpp_auth_token"; 36 const char kXmppAuthTokenOptionName[] = "xmpp_auth_token";
35 37
36 const char kClientLoginUrl[] = "https://www.google.com/accounts/ClientLogin"; 38 const char kClientLoginUrl[] = "https://www.google.com/accounts/ClientLogin";
37 39
38 const int64 kRequestTimeoutMs = 10 * 1000; 40 const int64_t kRequestTimeoutMs = 10 * 1000;
39 41
40 class ServiceStateURLRequestDelegate : public net::URLRequest::Delegate { 42 class ServiceStateURLRequestDelegate : public net::URLRequest::Delegate {
41 public: 43 public:
42 void OnResponseStarted(net::URLRequest* request) override { 44 void OnResponseStarted(net::URLRequest* request) override {
43 if (request->GetResponseCode() == 200) { 45 if (request->GetResponseCode() == 200) {
44 Read(request); 46 Read(request);
45 if (request->status().is_io_pending()) 47 if (request->status().is_io_pending())
46 return; 48 return;
47 } 49 }
48 request->Cancel(); 50 request->Cancel();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 const std::string& password, 214 const std::string& password,
213 const std::string& proxy_id) { 215 const std::string& proxy_id) {
214 robot_token_.clear(); 216 robot_token_.clear();
215 robot_email_.clear(); 217 robot_email_.clear();
216 email_ = email; 218 email_ = email;
217 proxy_id_ = proxy_id; 219 proxy_id_ = proxy_id;
218 auth_token_ = LoginToGoogle("cloudprint", email_, password); 220 auth_token_ = LoginToGoogle("cloudprint", email_, password);
219 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password); 221 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password);
220 return IsValid(); 222 return IsValid();
221 } 223 }
OLDNEW
« no previous file with comments | « cloud_print/service/service_state.h ('k') | cloud_print/service/service_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698