chromium/remoting/base/oauth_token_getter_impl.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/base/oauth_token_getter_impl.h"

#include <memory>
#include <utility>

#include "base/containers/queue.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/strings/string_util.h"
#include "google_apis/google_api_keys.h"
#include "remoting/base/logging.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"

namespace remoting {

namespace {

// Maximum number of retries on network/500 errors.
const int kMaxRetries =;

// Time when we we try to update OAuth token before its expiration.
const int kTokenUpdateTimeBeforeExpirySeconds =;

// Max time we wait for the response before giving up.
constexpr base::TimeDelta kResponseTimeoutDuration =;

}  // namespace

OAuthTokenGetterImpl::OAuthTokenGetterImpl(
    std::unique_ptr<OAuthIntermediateCredentials> intermediate_credentials,
    const OAuthTokenGetter::CredentialsUpdatedCallback& on_credentials_update,
    scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
    bool auto_refresh)
    :{}

OAuthTokenGetterImpl::OAuthTokenGetterImpl(
    std::unique_ptr<OAuthAuthorizationCredentials> authorization_credentials,
    scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
    bool auto_refresh)
    :{}

OAuthTokenGetterImpl::~OAuthTokenGetterImpl() {}

void OAuthTokenGetterImpl::OnGetTokensResponse(const std::string& refresh_token,
                                               const std::string& access_token,
                                               int expires_seconds) {}

void OAuthTokenGetterImpl::OnRefreshTokenResponse(
    const std::string& access_token,
    int expires_seconds) {}

void OAuthTokenGetterImpl::OnGetUserEmailResponse(
    const std::string& user_email) {}

void OAuthTokenGetterImpl::UpdateAccessToken(const std::string& access_token,
                                             int expires_seconds) {}

void OAuthTokenGetterImpl::NotifyTokenCallbacks(
    Status status,
    const std::string& user_email,
    const std::string& access_token) {}

void OAuthTokenGetterImpl::NotifyUpdatedCallbacks(
    const std::string& user_email,
    const std::string& refresh_token) {}

void OAuthTokenGetterImpl::OnOAuthError() {}

void OAuthTokenGetterImpl::OnNetworkError(int response_code) {}

void OAuthTokenGetterImpl::CallWithToken(TokenCallback on_access_token) {}

void OAuthTokenGetterImpl::InvalidateCache() {}

base::WeakPtr<OAuthTokenGetterImpl> OAuthTokenGetterImpl::GetWeakPtr() {}

void OAuthTokenGetterImpl::GetOauthTokensFromAuthCode() {}

void OAuthTokenGetterImpl::RefreshAccessToken() {}

bool OAuthTokenGetterImpl::IsResponsePending() const {}

void OAuthTokenGetterImpl::SetResponsePending(bool is_pending) {}

void OAuthTokenGetterImpl::OnResponseTimeout() {}

}  // namespace remoting