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

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

Issue 795043004: Standardize usage of virtual/override/final specifiers in printing code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 unified diff | Download patch
« no previous file with comments | « no previous file | printing/printing_context_linux.h » ('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 "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 20 matching lines...) Expand all
31 const char kRobotTokenOptionName[] = "robot_refresh_token"; 31 const char kRobotTokenOptionName[] = "robot_refresh_token";
32 const char kAuthTokenOptionName[] = "auth_token"; 32 const char kAuthTokenOptionName[] = "auth_token";
33 const char kXmppAuthTokenOptionName[] = "xmpp_auth_token"; 33 const char kXmppAuthTokenOptionName[] = "xmpp_auth_token";
34 34
35 const char kClientLoginUrl[] = "https://www.google.com/accounts/ClientLogin"; 35 const char kClientLoginUrl[] = "https://www.google.com/accounts/ClientLogin";
36 36
37 const int64 kRequestTimeoutMs = 10 * 1000; 37 const int64 kRequestTimeoutMs = 10 * 1000;
38 38
39 class ServiceStateURLRequestDelegate : public net::URLRequest::Delegate { 39 class ServiceStateURLRequestDelegate : public net::URLRequest::Delegate {
40 public: 40 public:
41 virtual void OnResponseStarted(net::URLRequest* request) override { 41 void OnResponseStarted(net::URLRequest* request) override {
42 if (request->GetResponseCode() == 200) { 42 if (request->GetResponseCode() == 200) {
43 Read(request); 43 Read(request);
44 if (request->status().is_io_pending()) 44 if (request->status().is_io_pending())
45 return; 45 return;
46 } 46 }
47 request->Cancel(); 47 request->Cancel();
48 } 48 }
49 49
50 virtual void OnReadCompleted(net::URLRequest* request, 50 void OnReadCompleted(net::URLRequest* request, int bytes_read) override {
51 int bytes_read) override {
52 Read(request); 51 Read(request);
53 if (!request->status().is_io_pending()) 52 if (!request->status().is_io_pending())
54 base::MessageLoop::current()->Quit(); 53 base::MessageLoop::current()->Quit();
55 } 54 }
56 55
57 const std::string& data() const { 56 const std::string& data() const {
58 return data_; 57 return data_;
59 } 58 }
60 59
61 private: 60 private:
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 const std::string& password, 212 const std::string& password,
214 const std::string& proxy_id) { 213 const std::string& proxy_id) {
215 robot_token_.clear(); 214 robot_token_.clear();
216 robot_email_.clear(); 215 robot_email_.clear();
217 email_ = email; 216 email_ = email;
218 proxy_id_ = proxy_id; 217 proxy_id_ = proxy_id;
219 auth_token_ = LoginToGoogle("cloudprint", email_, password); 218 auth_token_ = LoginToGoogle("cloudprint", email_, password);
220 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password); 219 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password);
221 return IsValid(); 220 return IsValid();
222 } 221 }
OLDNEW
« no previous file with comments | « no previous file | printing/printing_context_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698