[Safe Browsing] Remove signin deps from SafeBrowsingTokenFetcher
This CL removes the remaining deps on //components/signin from safe_browsing_token_fetcher.h in order to enable using this interface in //weblayer, which does not use //components/signin. Namely: - We remove the consent_level parameter altogether: in production it is always set to unconsented. - We replace the base::Optional<AccessTokenInfo> used for passing the access token to clients with just the std::string of the access token (empty if no access token was available, e.g., because of an error). This is all the state that clients used from the AccessTokenInfo. There is no behavioral change in this CL. One subtlety here is the metric computed in RealtimeUrlLookupService::OnGetAccessToken(). Currently it reports that a token was fetched if the base::Optional instance has a value. In this CL it reports that a token was fetched if the access_token string is non-empty. These cases actually coincide: - Currently, the base::Optional instance has a value iff the the underlying AccessTokenFetcher reports that there was no error in the fetch. - By the documentation of AccessTokenFetcher, the AccessTokenInfo returned from its fetch will also have a non-empty token exactly when there was no error reported by the fetch. Bug: 1080748 Change-Id: Ib0309417201c1906a0a4fb8bf71b9bac50d88bab Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611255 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by:Xinghui Lu <xinghuilu@chromium.org> Cr-Commit-Position: refs/heads/master@{#841498}
Showing
Please register or sign in to comment