Bug 199140 - Platform font class gets needlessly initialized in the Networking process
Summary: Platform font class gets needlessly initialized in the Networking process
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-23 17:27 PDT by mitz
Modified: 2019-06-24 09:25 PDT (History)
4 users (show)

See Also:


Attachments
Use NSClassFromString to avoid unnecessary initialization (4.16 KB, patch)
2019-06-23 17:33 PDT, mitz
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!