Commit fe6e6e52 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

MacPWAs: Move -[NSWorkspace sharedWorkspace] to UI thread

This is currently called on the IO thread, and is causing crashes.
It may be that this call can only been made on the UI thread.

Bug: 1067367
Change-Id: Iffb0c9d11f2c7fb6e9dcb496e7babe314a8f4232
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2143532Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758698}
parent 7d2ded22
...@@ -1200,11 +1200,19 @@ bool WebAppShortcutCreator::IsMultiProfile() const { ...@@ -1200,11 +1200,19 @@ bool WebAppShortcutCreator::IsMultiProfile() const {
void WebAppShortcutCreator::RevealAppShimInFinder( void WebAppShortcutCreator::RevealAppShimInFinder(
const base::FilePath& app_path) const { const base::FilePath& app_path) const {
// Use selectFile to show the contents of parent directory with the app auto closure = base::BindOnce(
// shim selected. [](const base::FilePath& app_path) {
[[NSWorkspace sharedWorkspace] // Use selectFile to show the contents of parent directory with the app
selectFile:base::mac::FilePathToNSString(app_path) // shim selected.
inFileViewerRootedAtPath:@""]; [[NSWorkspace sharedWorkspace]
selectFile:base::mac::FilePathToNSString(app_path)
inFileViewerRootedAtPath:@""];
},
app_path);
// Perform the call to NSWorkSpace on the UI thread. Calling it on the IO
// thread appears to cause crashes.
// https://crbug.com/1067367
base::PostTask(FROM_HERE, {content::BrowserThread::UI}, std::move(closure));
} }
void LaunchShim(LaunchShimUpdateBehavior update_behavior, void LaunchShim(LaunchShimUpdateBehavior update_behavior,
......
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