Bug 107492

Summary: [GTK][MAC] Use CoreFoundation
Product: WebKit Reporter: Laszlo Gombos <laszlo.gombos>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, benjamin, bugs-noreply, gustavo, hausmann, kevino, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed change none

Description Laszlo Gombos 2013-01-21 18:57:21 PST
OS() tests are preferred over a series of PLATFORM() tests for "for low-level services" - see also the discussion at bug 107406.

JavaScriptCore for OS(DARWIN) is used by PLATFORM(MAC), PLATFORM(QT) and PLATFORM(WX), so "PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WX) && OS(DARWIN)) || (PLATFORM(QT) && OS(DARWIN))" can be replaced by OS(DARWIN) which makes the code more readable as well.
Comment 1 Laszlo Gombos 2013-01-21 19:00:12 PST
Created attachment 183868 [details]
proposed change
Comment 2 Alexey Proskuryakov 2013-01-21 19:23:00 PST
Comment on attachment 183868 [details]
proposed change

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

> Source/JavaScriptCore/ChangeLog:8
> +        JavaScriptCore for OS(DARWIN) is used by PLATFORM(MAC), PLATFORM(QT)
> +        and PLATFORM(WX) so "PLATFORM(MAC)||PLATFORM(QT)||PLATFORM(WX)" is
> +        always true.

Can Gtk port be built on Mac?
Comment 3 Martin Robinson 2013-01-21 19:36:01 PST
(In reply to comment #2)

> > Source/JavaScriptCore/ChangeLog:8
> > +        JavaScriptCore for OS(DARWIN) is used by PLATFORM(MAC), PLATFORM(QT)
> > +        and PLATFORM(WX) so "PLATFORM(MAC)||PLATFORM(QT)||PLATFORM(WX)" is
> > +        always true.
> 
> Can Gtk port be built on Mac?

Yes.
Comment 4 Laszlo Gombos 2013-01-21 20:44:58 PST
(In reply to comment #3)
> (In reply to comment #2)
> 
> > > Source/JavaScriptCore/ChangeLog:8
> > > +        JavaScriptCore for OS(DARWIN) is used by PLATFORM(MAC), PLATFORM(QT)
> > > +        and PLATFORM(WX) so "PLATFORM(MAC)||PLATFORM(QT)||PLATFORM(WX)" is
> > > +        always true.
> > 
> > Can Gtk port be built on Mac?
> 
> Yes.

I did not know that it is supported. In that case this is probably a performance optimization for the GTK port on Mac. Would it be possible for someone to verify this change for the GTK port on Mac ?
Comment 5 Laszlo Gombos 2013-01-25 07:45:11 PST
Change the title to better reflect the functional change introduced by the patch. 

I cancel the review until we find someone who can help driving the GTK on MAC discussion.

The larger issue here is the GTK's port policy on using CoreFoundation on OS(DARWIN).

My sense is that reusing the CoreFoundation support from WebKit will make it easier to maintain the GTK MAC port, but I am not the right person to make this determination. Using CoreFoundation support from WebKit - USE(CF) - is the decision that the Qt and WX and CHROMIUM ports made on OS(DARWIN).
Comment 6 Martin Robinson 2013-01-25 08:04:25 PST
Okay. Assuming that this doesn't change functionality, it seems pretty harmless.
Comment 7 Laszlo Gombos 2013-01-26 18:36:37 PST
(In reply to comment #6)
> Okay. Assuming that this doesn't change functionality, it seems pretty harmless.

Likely there is a performance benefit for using CF directly.