Bug 224961 - Modernize ShareableResource::Handle
Summary: Modernize ShareableResource::Handle
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
Keywords: InRadar
Depends on:
Reported: 2021-04-22 17:11 PDT by Alex Christensen
Modified: 2021-05-08 17:18 PDT (History)
4 users (show)

See Also:

Patch (8.54 KB, patch)
2021-04-22 17:13 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (9.67 KB, patch)
2021-04-27 10:48 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2021-04-22 17:11:58 PDT
Modernize ShareableResource::Handle
Comment 1 Alex Christensen 2021-04-22 17:13:19 PDT
Created attachment 426869 [details]
Comment 2 Chris Dumez 2021-04-27 09:50:50 PDT
iOS bots are red.
Comment 3 Alex Christensen 2021-04-27 10:48:20 PDT
Created attachment 427165 [details]
Comment 4 Chris Dumez 2021-04-27 10:51:01 PDT
Comment on attachment 427165 [details]

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

> Source/WebKit/Shared/ShareableResource.cpp:148
> +auto ShareableResource::createHandle() -> Optional<Handle>

It seems weird to use Optional<Handle> considering that Handle has a "null" state and a isNull() function.

For example, we purposely avoid using Optional<String> in the code base, for this exact reason.

I think we could simply return a null Handle in case of failure.
Comment 5 Radar WebKit Bug Importer 2021-04-29 17:12:16 PDT