Return an empty font list when the permission is not given, or platform implementation is missing (e.g. Android). Also, remove the unused kCanceled status. #33350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously in the case of unsupported platform, the browser-side code returned FontEnumerationStatus::kUnexpectedError, while the renderer side handled FontEnumerationStatus::kUnimplementedError even though it would never been thrown under any case. We fix that behavior by updating the browser-side to throw an UnimplementedError, which the renderer handles by returning an empty font list. In general, the browser-side will provide specific information about font enumeration status, and the renderer-side will handle how users will receive the response. Similarly for permission denied or not given cases, the renderer-side will process FontEnumerationStatus::kPermissionDenied into an empty font list.
Bug: 1296792
Change-Id: I5c936a176d49453d3494bbc952831f83512c7db4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3547299
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Commit-Queue: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985005}