Skip to content
Commit 8bf2ea19 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Chromium LUCI CQ
Browse files

Add some abstractions around NSWorkspace methods for shortcuts.

setIcon:forFile: is not re-entrant and thus multiple calls to it need
to be sequenced. To ensure this is done, this adds a wrapper around the
method that does all the calls to this method on the same
SequencedTaskRunner. Existing usage of this method in web apps code
is migrated to use the new wrapper.

setDefaultApplicationAtURL: toOpenFileAtURL: only exists in macOS 12
and newer. To also support older OS versions, this CL adds a wrapper
that uses this method on macOS 12, and hardcodes the implementation of
this method for older OS versions. Unit tests verify that this does
indeed work even on older OS versions.

Bug: 333024272
Change-Id: I64574153e86d6471ed5c94710885c312f4c6356b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459962


Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288864}
parent e9d99617
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment