[webkit-dev] [webkit-changes] [264332] trunk/Source

Simon Fraser simon.fraser at apple.com
Tue Jul 14 14:38:26 PDT 2020


Could someone educate me about <wtf/Forward.h>? When should I use this instead of individual wtf headers?

Simon

> On Jul 14, 2020, at 2:32 PM, Sam Weinig <weinig at apple.com> wrote:
> 
> While I don’t want to take away from what Darin is saying here about correct usage of forward declaration and <wtf/Forward.h>, I’d like to understand why we have two different compilation models supported in WebKit. Is there a reason both need to be supported? Can we remove one?
> 
> - Sam
> 
>> On Jul 14, 2020, at 10:40 AM, Darin Adler <darin at apple.com <mailto:darin at apple.com>> wrote:
>> 
>> We need to be cautious about adding header includes to other headers. Adding includes to .cpp files is likely fine and not a deeply consequential decision, but adding to headers is something that can have a massive effect on build times over time.
>> 
>>> On Jul 13, 2020, at 10:44 PM, Hironori.Fujii at sony.com <mailto:Hironori.Fujii at sony.com> wrote:
>>>  <>Modified: trunk/Source/WebCore/platform/graphics/ColorSerialization.h (264331 => 264332)
>>> 
>>> --- trunk/Source/WebCore/platform/graphics/ColorSerialization.h	2020-07-14 05:17:20 UTC (rev 264331)
>>> +++ trunk/Source/WebCore/platform/graphics/ColorSerialization.h	2020-07-14 05:44:25 UTC (rev 264332)
>>> @@ -25,6 +25,8 @@
>>>  
>>>  #pragma once
>>>  
>>> +#include <wtf/text/WTFString.h>
>> This change is wrong. The header to include here is Forward.h, not WTFString.h. Not super-harmful since WTFString.h is already so widely included, but we need to be really cautious in headers.
>> 
>>> Modified: trunk/Source/WebCore/svg/SVGParserUtilities.h (264331 => 264332)
>>> 
>>> --- trunk/Source/WebCore/svg/SVGParserUtilities.h	2020-07-14 05:17:20 UTC (rev 264331)
>>> +++ trunk/Source/WebCore/svg/SVGParserUtilities.h	2020-07-14 05:44:25 UTC (rev 264332)
>>> @@ -24,6 +24,7 @@
>>>  #include "ParsingUtilities.h"
>>>  #include <wtf/HashSet.h>
>>>  #include <wtf/Vector.h>
>>> +#include <wtf/text/WTFString.h>
>> Same mistake.
>> 
>> I’d really like to come up with some other system for reviewing adding headers to *headers*.
>> 
>> — Darin
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org <mailto:webkit-dev at lists.webkit.org>
>> https://lists.webkit.org/mailman/listinfo/webkit-dev
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20200714/5e64dbab/attachment.htm>


More information about the webkit-dev mailing list