Commit 9c792c60 authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

Add expiry time to credentials

This will be used to refetch the credentials if
they have expired.

BUG=1124021

Change-Id: I69abebdb549122c3a928df5eff312bb5ad7f53ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388942Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803867}
parent dfd14b0e
...@@ -310,8 +310,10 @@ void KaleidoscopeDataProviderImpl::OnAccessTokenAvailable( ...@@ -310,8 +310,10 @@ void KaleidoscopeDataProviderImpl::OnAccessTokenAvailable(
DCHECK(token_fetcher_); DCHECK(token_fetcher_);
token_fetcher_.reset(); token_fetcher_.reset();
if (error.state() == GoogleServiceAuthError::State::NONE) if (error.state() == GoogleServiceAuthError::State::NONE) {
credentials_->access_token = access_token_info.token; credentials_->access_token = access_token_info.token;
credentials_->expiry_time = access_token_info.expiration_time;
}
for (auto& callback : pending_callbacks_) { for (auto& callback : pending_callbacks_) {
std::move(callback).Run(credentials_.Clone(), std::move(callback).Run(credentials_.Clone(),
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
module media.mojom; module media.mojom;
import "chrome/browser/media/feeds/media_feeds_store.mojom"; import "chrome/browser/media/feeds/media_feeds_store.mojom";
import "mojo/public/mojom/base/time.mojom";
import "url/mojom/origin.mojom"; import "url/mojom/origin.mojom";
// The result of getting the credentials. // The result of getting the credentials.
...@@ -22,6 +23,9 @@ struct Credentials { ...@@ -22,6 +23,9 @@ struct Credentials {
// An OAuth access token scoped to the Kaleidoscope API for the currently // An OAuth access token scoped to the Kaleidoscope API for the currently
// logged in user. If the user is not signed in then this will be empty. // logged in user. If the user is not signed in then this will be empty.
string? access_token; string? access_token;
// The time these credentials will expire.
mojo_base.mojom.Time? expiry_time;
}; };
enum KaleidoscopeTab { enum KaleidoscopeTab {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment