Bug 143423 - [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
Summary: [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be call...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-04-05 14:12 PDT by Darin Adler
Modified: 2015-04-05 15:25 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.23 KB, patch)
2015-04-05 14:24 PDT, Darin Adler
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2015-04-05 14:12:09 PDT
[Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
Comment 1 Darin Adler 2015-04-05 14:24:30 PDT
Created attachment 250167 [details]
Patch
Comment 2 Alexey Proskuryakov 2015-04-05 15:14:08 PDT
Comment on attachment 250167 [details]
Patch

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

r=me assuming that there is a reason to believe that WKSetApplicationInformationItem can be used from a secondary thread.

> Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm:270
> +#if USE(APPKIT)

We should probably use PLATFORM(MAC) now, as USE(APPKIT) is just a more confusing way to say the same.

> Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm:304
> +        WKSetApplicationInformationItem(CFSTR("LSActivePageUserVisibleOriginsKey"), activePageURLs.get());

Is this function documented to be usable from a secondary thread? It doesn't seem obvious that it would be safe - there is waiting for an IPC response, and dealing with app global data structures here.
Comment 3 Darin Adler 2015-04-05 15:22:19 PDT
(In reply to comment #2)
> Is this function documented to be usable from a secondary thread?

Yes. It says "Mac OS X threading: Thread safe" in the header.
Comment 4 Darin Adler 2015-04-05 15:23:26 PDT
Comment on attachment 250167 [details]
Patch

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

>> Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm:270
>> +#if USE(APPKIT)
> 
> We should probably use PLATFORM(MAC) now, as USE(APPKIT) is just a more confusing way to say the same.

I’m not sure what changed from when we first wrote the code, but I’ll do it. I think USE(APPKIT) is better than PLATFORM(MAC) when we are actually talking about AppKit, but I suppose WKSetApplicationInformationItem is hardly AppKit.
Comment 5 Darin Adler 2015-04-05 15:25:18 PDT
Committed r182366: <http://trac.webkit.org/changeset/182366>
Comment 6 mitz 2015-04-05 15:25:54 PDT
rdar://problem/18773785