RESOLVED WONTFIX 182166
ServicesController::refreshExistingServices invokes NSSharingService sharingServicesForItems in a background thread
https://bugs.webkit.org/show_bug.cgi?id=182166
Summary ServicesController::refreshExistingServices invokes NSSharingService sharingS...
Ryosuke Niwa
Reported 2018-01-25 22:22:08 PST
NSSharingService sharingServicesForItems calls into AppKit so can't be called in a background thread but we're doing that in ServicesController::refreshExistingServices
Attachments
Ryosuke Niwa
Comment 1 2018-01-25 22:23:29 PST
Main Thread Checker: UI API called on a background thread: -[NSCell image] PID: 33220, TID: 7447672, Thread name: (none), Queue name: com.apple.WebKit.ServicesController, QoS: 0 Backtrace: 4 ShareKit 0x00007fff600a7d16 __72+[SHKSandbox filteredItemsFromAttributedString:processWithPID:textView:]_block_invoke + 348 5 Foundation 0x00007fff4165a6ca -[NSAttributedString enumerateAttribute:inRange:options:usingBlock:] + 397 6 ShareKit 0x00007fff600a7a59 +[SHKSandbox filteredItemsFromAttributedString:processWithPID:textView:] + 421 7 ShareKit 0x00007fff600a6759 +[SHKSandbox filteredItemsFromSingleItem:processWithPID:] + 218 8 ShareKit 0x00007fff600a65b3 +[SHKSandbox filteredItemsFromItems:processWithPID:] + 439 9 ShareKit 0x00007fff600a06ad +[SHKSharingService sharingServicesForItems:mask:invokedByPicker:] + 249 10 AppKit 0x00007fff3cb1a3fa +[NSSharingService sharingServicesForItems:mask:] + 67 11 WebKit 0x00000001050fe7fa _ZN6WebKitL29hasCompatibleServicesForItemsEP7NSArray + 42 12 WebKit 0x00000001050fe70f ___ZN6WebKit18ServicesController23refreshExistingServicesEb_block_invoke + 495 13 libdispatch.dylib 0x000000010962ec3d _dispatch_call_block_and_release + 12 14 libdispatch.dylib 0x0000000109626d1f _dispatch_client_callout + 8 15 libdispatch.dylib 0x000000010963cbac _dispatch_queue_serial_drain + 1169 16 libdispatch.dylib 0x000000010962e790 _dispatch_queue_invoke + 322 17 libdispatch.dylib 0x000000010963dfbb _dispatch_root_queue_drain_deferred_wlh + 785 18 libdispatch.dylib 0x0000000109642e94 _dispatch_workloop_worker_thread + 892 19 libsystem_pthread.dylib 0x00000001096a302b _pthread_wqthread + 980 20 libsystem_pthread.dylib 0x00000001096a2c45 start_wqthread + 13
mitz
Comment 2 2018-01-25 22:32:06 PST
This is done because calling it on the main thread caused noticeable delays. The API was made safe to call on a background thread via <rdar://problem/18139613> but has since regressed. Fixing the regression is tracked in <rdar://problem/32116152> and others.
mitz
Comment 3 2018-01-25 22:33:14 PST
Tim Horton
Comment 4 2018-01-25 22:54:28 PST
Right, what Dan said.
Note You need to log in before you can comment on or make changes to this bug.