Bug 136356

Summary: Occasional thread-safety-related crashes on the ServicesController queue
Product: WebKit Reporter: Tim Horton <thorton>
Component: WebKit2Assignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, commit-queue, enrica, mitz, mrowe, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
mitz: review+
patch mitz: review+

Description Tim Horton 2014-08-28 16:44:31 PDT
We shouldn't use API that makes an NSMenu anywhere but the main thread.

Instead, use alternate SPI.

rdar://problem/18045685
Comment 1 Tim Horton 2014-08-28 16:47:48 PDT
Created attachment 237330 [details]
patch
Comment 2 mitz 2014-08-28 16:52:39 PDT
Comment on attachment 237330 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=237330&action=review

> Source/WebKit2/UIProcess/mac/ServicesController.mm:109
> +    NSSharingServiceMask serviceMask = NSSharingServiceMaskViewer | NSSharingServiceMaskEditor;

I don’t see why this variable is needed.

> Source/WebKit2/UIProcess/mac/ServicesController.mm:110
> +    return [[NSSharingService sharingServicesForItems:items mask:serviceMask] count];

You can use .count notation here!
Comment 3 Tim Horton 2014-08-28 16:53:27 PDT
Created attachment 237331 [details]
patch
Comment 4 mitz 2014-08-28 16:55:09 PDT
Comment on attachment 237331 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=237331&action=review

> Source/WebKit2/UIProcess/mac/ServicesController.mm:115
> +    NSSharingServiceMask serviceMask = NSSharingServiceMaskViewer | NSSharingServiceMaskEditor;

:-|
Comment 5 WebKit Commit Bot 2014-08-28 16:56:18 PDT
Attachment 237331 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/mac/ServicesController.mm:52:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Tim Horton 2014-08-28 16:58:40 PDT
http://trac.webkit.org/changeset/173092