base::OnceCallback<void(std::optional<AccessTokenInfo>,
GoogleServiceAuthError)>;Would it be possible to use `base::expected<AccessTokenInfo, GoogleServiceAuthError>` instead?
using AccessTokenCallbackWithAuthError =It will be hard to rename this later (as it is used across public and internal repos). Would it be possible to use a shorter name instead (`AccessTokenRequestCallback`)? I don't think it's going to be an issue if we drop `WithAuthError` from the name - in the long run the callback with `NSError` will go away and there won't be any ambiguity.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
base::OnceCallback<void(std::optional<AccessTokenInfo>,
GoogleServiceAuthError)>;Would it be possible to use `base::expected<AccessTokenInfo, GoogleServiceAuthError>` instead?
Done
It will be hard to rename this later (as it is used across public and internal repos). Would it be possible to use a shorter name instead (`AccessTokenRequestCallback`)? I don't think it's going to be an issue if we drop `WithAuthError` from the name - in the long run the callback with `NSError` will go away and there won't be any ambiguity.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The GoogleServiceAuthErrorFromError conversion method, currently in
device_accounts_provider_impl.mm, will also be moved to ios_internal in
a follow-up CL (https://crrev.com/i/9175936).Sorry if I missed something, why do we need to move this implementation ?
Anything added in ios_internal becomes a pain to update so I would recommend only doing this if it is strictly necessary.
// Asynchronously retrieves access tokens for `identity` with `scopes`. The
// callback is invoked on the calling sequence when the operation completes.Should a TODO be added here to delete this method after launch?
// Same as 'AccessTokenCallback' but with GoogleServiceAuthErrornit: When the feature flag is cleaned up, AccessTokenCallback will be deleted, won't it ? Just to make sure we don't forget to update it later, it might be worth adding a standalone comment here from the get-go.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The GoogleServiceAuthErrorFromError conversion method, currently in
device_accounts_provider_impl.mm, will also be moved to ios_internal in
a follow-up CL (https://crrev.com/i/9175936).Sorry if I missed something, why do we need to move this implementation ?
Anything added in ios_internal becomes a pain to update so I would recommend only doing this if it is strictly necessary.
The move is necessary for the case we have a mdm error: we will need to populate [IOSDeviceManagementErrorDetails](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/signin/model/ios_device_management_error_details.h?q=IOSDeviceManagementErrorDetails) using GCRDeviceService and some methods exposed from google3 so the conversion has to happen in ios_internal
// Asynchronously retrieves access tokens for `identity` with `scopes`. The
// callback is invoked on the calling sequence when the operation completes.Should a TODO be added here to delete this method after launch?
Done (crbug.com/502126003)
// Same as 'AccessTokenCallback' but with GoogleServiceAuthErrornit: When the feature flag is cleaned up, AccessTokenCallback will be deleted, won't it ? Just to make sure we don't forget to update it later, it might be worth adding a standalone comment here from the get-go.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
AccessTokenRequestCallback callback) {}Please add a TODO to make this method pure virtual after updating the internal implementation.
virtual void GetAccessToken(id<SystemIdentity> identity,Add a comment to clarify what this does.
// Same as 'AccessTokenCallback' but with GoogleServiceAuthError[Nit] This comment will need to be updated when `AccessTokenCallback` is deleted, please consider writing a proper comment for it now to simplify the future cleanup.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The GoogleServiceAuthErrorFromError conversion method, currently in
device_accounts_provider_impl.mm, will also be moved to ios_internal in
a follow-up CL (https://crrev.com/i/9175936).Arnaud YameogoSorry if I missed something, why do we need to move this implementation ?
Anything added in ios_internal becomes a pain to update so I would recommend only doing this if it is strictly necessary.
The move is necessary for the case we have a mdm error: we will need to populate [IOSDeviceManagementErrorDetails](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/signin/model/ios_device_management_error_details.h?q=IOSDeviceManagementErrorDetails) using GCRDeviceService and some methods exposed from google3 so the conversion has to happen in ios_internal
Marked as resolved.
Please add a TODO to make this method pure virtual after updating the internal implementation.
Done(crbug.com/502440730)
virtual void GetAccessToken(id<SystemIdentity> identity,Add a comment to clarify what this does.
Done
// Same as 'AccessTokenCallback' but with GoogleServiceAuthError[Nit] This comment will need to be updated when `AccessTokenCallback` is deleted, please consider writing a proper comment for it now to simplify the future cleanup.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
The GoogleServiceAuthErrorFromError conversion method, currently in
device_accounts_provider_impl.mm, will also be moved to ios_internal in
a follow-up CL (https://crrev.com/i/9175936).Arnaud YameogoSorry if I missed something, why do we need to move this implementation ?
Anything added in ios_internal becomes a pain to update so I would recommend only doing this if it is strictly necessary.
Arnaud YameogoThe move is necessary for the case we have a mdm error: we will need to populate [IOSDeviceManagementErrorDetails](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/signin/model/ios_device_management_error_details.h?q=IOSDeviceManagementErrorDetails) using GCRDeviceService and some methods exposed from google3 so the conversion has to happen in ios_internal
Marked as resolved.
Ideally we should have the minimum amount of code in ios_internal. If the conversion API is currently public then let's keep it that way and keep only the part of the conversion that calls the DeviceService in ios_internal.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The GoogleServiceAuthErrorFromError conversion method, currently in
device_accounts_provider_impl.mm, will also be moved to ios_internal in
a follow-up CL (https://crrev.com/i/9175936).Arnaud YameogoSorry if I missed something, why do we need to move this implementation ?
Anything added in ios_internal becomes a pain to update so I would recommend only doing this if it is strictly necessary.
Arnaud YameogoThe move is necessary for the case we have a mdm error: we will need to populate [IOSDeviceManagementErrorDetails](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/signin/model/ios_device_management_error_details.h?q=IOSDeviceManagementErrorDetails) using GCRDeviceService and some methods exposed from google3 so the conversion has to happen in ios_internal
Samar ChehadeMarked as resolved.
Arnaud YameogoIdeally we should have the minimum amount of code in ios_internal. If the conversion API is currently public then let's keep it that way and keep only the part of the conversion that calls the DeviceService in ios_internal.
Marked as resolved.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[iOS][Signin] Use GoogleServiceAuthError in AccessTokenCallback
This CL replaces NSError with GoogleServiceAuthError in the
AccessTokenCallback and overloads the GetAccessToken method. The new
implementation with the updated callback will be added in ios_internal.
The GoogleServiceAuthErrorFromError conversion method, currently in
device_accounts_provider_impl.mm, will also be moved to ios_internal in
a follow-up CL (https://crrev.com/i/9175936).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |