Bug 96254 - [WTR] Generated source files should include config.h
Summary: [WTR] Generated source files should include config.h
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryuan Choi
URL:
Keywords:
Depends on:
Blocks: 96273
  Show dependency treegraph
 
Reported: 2012-09-10 03:06 PDT by Ryuan Choi
Modified: 2012-09-10 14:43 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.55 KB, patch)
2012-09-10 06:38 PDT, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (1.57 KB, patch)
2012-09-10 07:07 PDT, Ryuan Choi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryuan Choi 2012-09-10 03:06:29 PDT
As http://www.webkit.org/coding/coding-style.html mentioned,
all implementations should include config.h.
Comment 1 Ryuan Choi 2012-09-10 06:38:50 PDT
Created attachment 163115 [details]
Patch
Comment 2 Ryuan Choi 2012-09-10 07:07:11 PDT
Created attachment 163119 [details]
Patch
Comment 3 Benjamin Poulain 2012-09-10 12:59:44 PDT
Is this solving a real problem? You are just gonna slow down compile time for following the coding style _guidelines_.
Comment 4 Ryuan Choi 2012-09-10 13:53:16 PDT
(In reply to comment #3)
> Is this solving a real problem? You are just gonna slow down compile time for following the coding style _guidelines_.

Yes.

In fact, a real problem is that WTR/Efl can not distinguish compile time options such as ENABLE(TOUCH_EVENTS) because
 - Derived sources does not include config.h
 WebKit/Efl does not use pre compiled header,
 so we should include config.h to determine options

 - CMake build scripts does not provide FEATURE DEFINES to generator. (Bug 96273 for this)

After solving above issues, I want to implement missing functionality of TOUCH EVENTS in EventSenderProxyEfl.cpp

Thank you.
Comment 5 Benjamin Poulain 2012-09-10 14:03:18 PDT
Comment on attachment 163119 [details]
Patch

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

> In fact, a real problem is that WTR/Efl can not distinguish compile time options such as ENABLE(TOUCH_EVENTS) because
>  - Derived sources does not include config.h
>  WebKit/Efl does not use pre compiled header,
>  so we should include config.h to determine options
> 
>  - CMake build scripts does not provide FEATURE DEFINES to generator. (Bug 96273 for this)

That's a good justification.

> Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:332
>      unshift(@contents, map { "#include \"$_\"\n" } sort keys(%contentsIncludes));
> +    unshift(@contents, "#include \"config.h\"\n");
>      unshift(@contents, @contentsPrefix);

Is this really respecting the order of #includes regarding config.h?
Comment 6 Ryuan Choi 2012-09-10 14:18:19 PDT
Comment on attachment 163119 [details]
Patch

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

>> Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:332
>>      unshift(@contents, @contentsPrefix);
> 
> Is this really respecting the order of #includes regarding config.h?

Yes, this obey the order of #include rule 1, `All implementation files must #include "config.h" first. Header files should never include "config.h"`.

CodeGeneratorTestRunner.pm still not follow other rules (All other headers are sorted).
Comment 7 Benjamin Poulain 2012-09-10 14:25:30 PDT
Comment on attachment 163119 [details]
Patch

> Yes, this obey the order of #include rule 1, `All implementation files must #include "config.h" first. Header files should never include "config.h"`.

Oh, right! This is unshift, not shift. LGTM.
Comment 8 Ryuan Choi 2012-09-10 14:27:42 PDT
Comment on attachment 163119 [details]
Patch

Thank you.
Comment 9 WebKit Review Bot 2012-09-10 14:43:19 PDT
Comment on attachment 163119 [details]
Patch

Clearing flags on attachment: 163119

Committed r128108: <http://trac.webkit.org/changeset/128108>
Comment 10 WebKit Review Bot 2012-09-10 14:43:23 PDT
All reviewed patches have been landed.  Closing bug.