Bug 223481

Summary: WebCore::ThreadGlobalData should not initialize fields eagerly
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, jonlee, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Yusuke Suzuki 2021-03-18 14:37:57 PDT
WebCore::ThreadGlobalData should not initialize fields eagerly
Comment 1 Yusuke Suzuki 2021-03-18 14:40:15 PDT
Created attachment 423660 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-03-18 14:41:23 PDT
<rdar://problem/75591436>
Comment 3 Chris Dumez 2021-03-18 14:57:37 PDT
Comment on attachment 423660 [details]
Patch

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

> Source/WebCore/platform/ThreadGlobalData.cpp:118
> +void ThreadGlobalData::initializeCachedResourceRequestInitiators()

Why the separate initialize*() functions? Seems we could inline all those.
Comment 4 Yusuke Suzuki 2021-03-18 14:59:47 PDT
Comment on attachment 423660 [details]
Patch

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

>> Source/WebCore/platform/ThreadGlobalData.cpp:118
>> +void ThreadGlobalData::initializeCachedResourceRequestInitiators()
> 
> Why the separate initialize*() functions? Seems we could inline all those.

Because this should be executed rarely, I've extracted it from inlined part of the function.
Comment 5 Yusuke Suzuki 2021-03-18 15:00:27 PDT
Comment on attachment 423660 [details]
Patch

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

>>> Source/WebCore/platform/ThreadGlobalData.cpp:118
>>> +void ThreadGlobalData::initializeCachedResourceRequestInitiators()
>> 
>> Why the separate initialize*() functions? Seems we could inline all those.
> 
> Because this should be executed rarely, I've extracted it from inlined part of the function.

This also allows us not to include CachedResourceRequestInitiators.h EventNames.h QualifiedNameCache.h etc. in the header side.
Comment 6 Chris Dumez 2021-03-18 15:02:26 PDT
Comment on attachment 423660 [details]
Patch

OK
Comment 7 EWS 2021-03-19 00:54:46 PDT
Committed r274705: <https://commits.webkit.org/r274705>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423660 [details].