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

Unified Diff: remoting/base/oauth_token_getter_impl.cc

Issue 2661153003: Moving oauth code from host to base to allow code sharing between host and client. (Closed)
Patch Set: Merge branch 'master' into auth_token Created 3 years, 11 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
« no previous file with comments | « remoting/base/oauth_token_getter_impl.h ('k') | remoting/host/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/oauth_token_getter_impl.cc
diff --git a/remoting/host/oauth_token_getter_impl.cc b/remoting/base/oauth_token_getter_impl.cc
similarity index 93%
rename from remoting/host/oauth_token_getter_impl.cc
rename to remoting/base/oauth_token_getter_impl.cc
index 83404d8ef8de22c1db2a8b076a7ae9b033669317..9a8e384ae72fd3ef32a7da288ec460d847d9641c 100644
--- a/remoting/host/oauth_token_getter_impl.cc
+++ b/remoting/base/oauth_token_getter_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/oauth_token_getter_impl.h"
+#include "remoting/base/oauth_token_getter_impl.h"
#include <utility>
@@ -52,7 +52,7 @@ void OAuthTokenGetterImpl::OnRefreshTokenResponse(
int expires_seconds) {
DCHECK(CalledOnValidThread());
DCHECK(oauth_credentials_.get());
- HOST_LOG << "Received OAuth token.";
+ VLOG(1) << "Received OAuth token.";
oauth_access_token_ = access_token;
base::TimeDelta token_expiration =
@@ -79,7 +79,7 @@ void OAuthTokenGetterImpl::OnGetUserEmailResponse(
const std::string& user_email) {
DCHECK(CalledOnValidThread());
DCHECK(oauth_credentials_.get());
- HOST_LOG << "Received user info.";
+ VLOG(1) << "Received user info.";
if (user_email != oauth_credentials_->login) {
LOG(ERROR) << "OAuth token and email address do not refer to "
@@ -134,10 +134,10 @@ void OAuthTokenGetterImpl::OnNetworkError(int response_code) {
void OAuthTokenGetterImpl::CallWithToken(const TokenCallback& on_access_token) {
DCHECK(CalledOnValidThread());
- bool need_new_auth_token = auth_token_expiry_time_.is_null() ||
- base::Time::Now() >= auth_token_expiry_time_ ||
- (!oauth_credentials_->is_service_account &&
- !email_verified_);
+ bool need_new_auth_token =
+ auth_token_expiry_time_.is_null() ||
+ base::Time::Now() >= auth_token_expiry_time_ ||
+ (!oauth_credentials_->is_service_account && !email_verified_);
if (need_new_auth_token) {
pending_callbacks_.push(on_access_token);
@@ -156,7 +156,7 @@ void OAuthTokenGetterImpl::InvalidateCache() {
void OAuthTokenGetterImpl::RefreshOAuthToken() {
DCHECK(CalledOnValidThread());
- HOST_LOG << "Refreshing OAuth token.";
+ VLOG(1) << "Refreshing OAuth token.";
DCHECK(!refreshing_oauth_token_);
// Service accounts use different API keys, as they use the client app flow.
« no previous file with comments | « remoting/base/oauth_token_getter_impl.h ('k') | remoting/host/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698