Bug 199140

Summary: Platform font class gets needlessly initialized in the Networking process
Product: WebKit Reporter: mitz
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=199119
Attachments:
Description Flags
Use NSClassFromString to avoid unnecessary initialization none

Description mitz 2019-06-23 17:27:59 PDT
typeFromObject() in ArgumentCodersCocoa.mm calls [PlatformFont class] which invokes the class’s initializer. This is wasteful to do in the Networking process, which doesn’t use the class otherwise.
Comment 1 mitz 2019-06-23 17:33:06 PDT
Created attachment 372721 [details]
Use NSClassFromString to avoid unnecessary initialization
Comment 2 WebKit Commit Bot 2019-06-23 20:44:57 PDT
Comment on attachment 372721 [details]
Use NSClassFromString to avoid unnecessary initialization

Clearing flags on attachment: 372721

Committed r246726: <https://trac.webkit.org/changeset/246726>
Comment 3 WebKit Commit Bot 2019-06-23 20:44:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2019-06-23 20:48:00 PDT
<rdar://problem/52040306>
Comment 5 Brent Fulgham 2019-06-24 09:25:07 PDT
Comment on attachment 372721 [details]
Use NSClassFromString to avoid unnecessary initialization

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

> Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:115
> +    if ([object isKindOfClass:platformColorClass()])

Oh, really nice. Thank you guys for improving that!