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

Side by Side Diff: remoting/host/oauth_token_getter_impl.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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 | « remoting/host/oauth_token_getter_impl.h ('k') | remoting/host/resizing_host_observer.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/host/oauth_token_getter_impl.h" 5 #include "remoting/host/oauth_token_getter_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "google_apis/google_api_keys.h" 10 #include "google_apis/google_api_keys.h"
(...skipping 15 matching lines...) Expand all
26 OAuthTokenGetterImpl::OAuthTokenGetterImpl( 26 OAuthTokenGetterImpl::OAuthTokenGetterImpl(
27 scoped_ptr<OAuthCredentials> oauth_credentials, 27 scoped_ptr<OAuthCredentials> oauth_credentials,
28 const scoped_refptr<net::URLRequestContextGetter>& 28 const scoped_refptr<net::URLRequestContextGetter>&
29 url_request_context_getter, 29 url_request_context_getter,
30 bool auto_refresh) 30 bool auto_refresh)
31 : oauth_credentials_(oauth_credentials.Pass()), 31 : oauth_credentials_(oauth_credentials.Pass()),
32 gaia_oauth_client_( 32 gaia_oauth_client_(
33 new gaia::GaiaOAuthClient(url_request_context_getter.get())), 33 new gaia::GaiaOAuthClient(url_request_context_getter.get())),
34 url_request_context_getter_(url_request_context_getter) { 34 url_request_context_getter_(url_request_context_getter) {
35 if (auto_refresh) { 35 if (auto_refresh) {
36 refresh_timer_.reset(new base::OneShotTimer<OAuthTokenGetterImpl>()); 36 refresh_timer_.reset(new base::OneShotTimer());
37 } 37 }
38 } 38 }
39 39
40 OAuthTokenGetterImpl::~OAuthTokenGetterImpl() { 40 OAuthTokenGetterImpl::~OAuthTokenGetterImpl() {
41 } 41 }
42 42
43 void OAuthTokenGetterImpl::OnGetTokensResponse(const std::string& user_email, 43 void OAuthTokenGetterImpl::OnGetTokensResponse(const std::string& user_email,
44 const std::string& access_token, 44 const std::string& access_token,
45 int expires_seconds) { 45 int expires_seconds) {
46 NOTREACHED(); 46 NOTREACHED();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ""}; 166 ""};
167 167
168 refreshing_oauth_token_ = true; 168 refreshing_oauth_token_ = true;
169 std::vector<std::string> empty_scope_list; // Use scope from refresh token. 169 std::vector<std::string> empty_scope_list; // Use scope from refresh token.
170 gaia_oauth_client_->RefreshToken(client_info, 170 gaia_oauth_client_->RefreshToken(client_info,
171 oauth_credentials_->refresh_token, 171 oauth_credentials_->refresh_token,
172 empty_scope_list, kMaxRetries, this); 172 empty_scope_list, kMaxRetries, this);
173 } 173 }
174 174
175 } // namespace remoting 175 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/oauth_token_getter_impl.h ('k') | remoting/host/resizing_host_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698