Bug 127706 - Scrub WebKit API headers of WTF macros
Summary: Scrub WebKit API headers of WTF macros
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andy Estes
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-01-27 13:46 PST by Andy Estes
Modified: 2014-01-27 15:57 PST (History)
10 users (show)

See Also:


Attachments
Stop the code generator from adding ENABLE() macros to Objective-C DOM headers (9.38 KB, patch)
2014-01-27 13:57 PST, Andy Estes
no flags Details | Formatted Diff | Diff
Scrub WebKit API headers of WTF macros (39.48 KB, patch)
2014-01-27 15:35 PST, Andy Estes
ddkilzer: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2014-01-27 13:46:49 PST
WebKit Public/Private headers shouldn't use WTF preprocessor macros such as PLATFORM(), ENABLE(), USE(), etc. I'll do this in two stages:

1) Stop the code generator from adding ENABLE() macros to Objective-C DOM headers.
2) Manually scrub non-generated exported headers
Comment 1 Andy Estes 2014-01-27 13:48:11 PST
<rdar://problem/15842819>
Comment 2 Andy Estes 2014-01-27 13:57:22 PST
Created attachment 222353 [details]
Stop the code generator from adding ENABLE() macros to Objective-C DOM headers
Comment 3 David Kilzer (:ddkilzer) 2014-01-27 14:27:33 PST
Comment on attachment 222353 [details]
Stop the code generator from adding ENABLE() macros to Objective-C DOM headers

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

r=me

> Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm:800
> +    my %defines = map { $_ => 1 } split(/\s+/, $definesString);

It would be better to do this in GenerateHeader and pass in the hash than to recreate it every time.

You can do this by declaring a subroutine prototype at the "top" of the perl script:

sub ConditionalIsEnabled(\%$);

and then add the argument prototypes above:

sub ConditionalIsEnabled(\%$)
{

Then call it using:  ConditionalIsEnabled(%defines, $mystring)

> Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm:803
> +        return exists($defines{"ENABLE_" . $conditional});

If making the change above, this becomes:

return exists($defines->{"ENABLE_" . $conditional});
Comment 4 Andy Estes 2014-01-27 15:11:06 PST
Committed r162872: <http://trac.webkit.org/changeset/162872>
Comment 5 Andy Estes 2014-01-27 15:35:09 PST
Created attachment 222370 [details]
Scrub WebKit API headers of WTF macros
Comment 6 David Kilzer (:ddkilzer) 2014-01-27 15:48:40 PST
Comment on attachment 222370 [details]
Scrub WebKit API headers of WTF macros

r=me
Comment 7 Andy Estes 2014-01-27 15:57:00 PST
Committed r162881: <http://trac.webkit.org/changeset/162881>