Bug 205221 - Add NS_UNAVAILABLE tags to prevent alloc inits for _WKResourceLoadStatistics* classes
Summary: Add NS_UNAVAILABLE tags to prevent alloc inits for _WKResourceLoadStatistics*...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kate Cheney
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-12-13 15:27 PST by Kate Cheney
Modified: 2019-12-16 09:11 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.43 KB, patch)
2019-12-13 15:30 PST, Kate Cheney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kate Cheney 2019-12-13 15:27:27 PST
_WKResourceLoadStatistics* classes should only be created via API::ResourceLoadStatistics*::create
Comment 1 Radar WebKit Bug Importer 2019-12-13 15:28:09 PST
<rdar://problem/57927809>
Comment 2 Kate Cheney 2019-12-13 15:30:51 PST
Created attachment 385649 [details]
Patch
Comment 3 Darin Adler 2019-12-15 17:15:46 PST
Comment on attachment 385649 [details]
Patch

This prevents accidental init at compile time if someone has the appropriate SDK headers, but to prevent it at runtime I believe the typical technique is to override init with a method that throws an exception.
Comment 4 Kate Cheney 2019-12-16 08:33:58 PST
(In reply to Darin Adler from comment #3)
> Comment on attachment 385649 [details]
> Patch
> 
> This prevents accidental init at compile time if someone has the appropriate
> SDK headers, but to prevent it at runtime I believe the typical technique is
> to override init with a method that throws an exception.

Good to know, I will address this in a future patch.
Comment 5 WebKit Commit Bot 2019-12-16 09:11:02 PST
Comment on attachment 385649 [details]
Patch

Clearing flags on attachment: 385649

Committed r253557: <https://trac.webkit.org/changeset/253557>
Comment 6 WebKit Commit Bot 2019-12-16 09:11:04 PST
All reviewed patches have been landed.  Closing bug.