Commit d170943c authored by Kush Sinha's avatar Kush Sinha Committed by Commit Bot

Cleanup conditional token revocation in MPO2TSDelegate

MutableProfileOAuth2TokenServiceDelegate takes a boolean constructor
parameter to assess whether token revocation is supported. This was
required only on Chrome OS, for supervised users.

With the introduction of Chrome OS Account Manager, this code path is no
longer used. i.e. revoking all tokens from "Chrome" is no longer
supported. This was partially cleaned up in https://crrev.com/c/1833609,
which set the aforementioned parameter to |true| by default.

Clean it up completely by removing the parameter altogether since it is
always set to |true| anyways.

Bug: 1010532
Change-Id: Idf585b5e6c2096febce83e641443fce394968319
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1852427Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Kush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704620}
parent 3b5c61d7
......@@ -242,7 +242,6 @@ MutableProfileOAuth2TokenServiceDelegate::
scoped_refptr<TokenWebData> token_web_data,
signin::AccountConsistencyMethod account_consistency,
bool revoke_all_tokens_on_load,
bool can_revoke_credentials,
FixRequestErrorCallback fix_request_error_callback)
: web_data_service_request_(0),
backoff_entry_(&backoff_policy_),
......@@ -253,7 +252,6 @@ MutableProfileOAuth2TokenServiceDelegate::
token_web_data_(token_web_data),
account_consistency_(account_consistency),
revoke_all_tokens_on_load_(revoke_all_tokens_on_load),
can_revoke_credentials_(can_revoke_credentials),
fix_request_error_callback_(fix_request_error_callback) {
VLOG(1) << "MutablePO2TS::MutablePO2TS";
DCHECK(client);
......@@ -735,8 +733,6 @@ void MutableProfileOAuth2TokenServiceDelegate::PersistCredentials(
}
void MutableProfileOAuth2TokenServiceDelegate::RevokeAllCredentials() {
if (!can_revoke_credentials_)
return;
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
VLOG(1) << "MutablePO2TS::RevokeAllCredentials";
......
......@@ -5,7 +5,9 @@
#ifndef COMPONENTS_SIGNIN_INTERNAL_IDENTITY_MANAGER_MUTABLE_PROFILE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_
#define COMPONENTS_SIGNIN_INTERNAL_IDENTITY_MANAGER_MUTABLE_PROFILE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "base/callback.h"
......@@ -39,7 +41,6 @@ class MutableProfileOAuth2TokenServiceDelegate
scoped_refptr<TokenWebData> token_web_data,
signin::AccountConsistencyMethod account_consistency,
bool revoke_all_tokens_on_load,
bool can_revoke_credentials,
FixRequestErrorCallback fix_request_error_callback);
~MutableProfileOAuth2TokenServiceDelegate() override;
......@@ -229,11 +230,6 @@ class MutableProfileOAuth2TokenServiceDelegate
// error state.
const bool revoke_all_tokens_on_load_;
// Supervised users cannot revoke credentials.
// TODO(droger): remove this when supervised users are no longer supported on
// any platform.
const bool can_revoke_credentials_;
// Callback function that attempts to correct request errors. Best effort
// only. Returns true if the error was fixed and retry should be reattempted.
FixRequestErrorCallback fix_request_error_callback_;
......
......@@ -147,7 +147,6 @@ class MutableProfileOAuth2TokenServiceDelegateTest
client_.get(), &account_tracker_service_,
network::TestNetworkConnectionTracker::GetInstance(), token_web_data_,
account_consistency, revoke_all_tokens_on_load_,
true /* can_revoke_credantials */,
MutableProfileOAuth2TokenServiceDelegate::FixRequestErrorCallback());
}
......
......@@ -90,7 +90,6 @@ CreateMutableProfileOAuthDelegate(
return std::make_unique<MutableProfileOAuth2TokenServiceDelegate>(
signin_client, account_tracker_service, network_connection_tracker,
token_web_data, account_consistency, revoke_all_tokens_on_load,
true /* can_revoke_credentials */,
#if defined(OS_WIN)
reauth_callback
#else
......
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