Summary: | [Cocoa] Update MESSAGE_CHECK macros used in WebProcessProxy::didCreateSleepDisabler/WebProcessProxy::didDestroySleepDisabler | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
Component: | WebKit Misc. | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bfulgham, darin, ggaren, pvollan, useafterfree | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | 209676 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
David Kilzer (:ddkilzer)
2020-04-03 12:33:57 PDT
Created attachment 395402 [details]
Patch v1
Comment on attachment 395402 [details]
Patch v1
So decoding always checks for both invalid hash table values for identifiers?
Comment on attachment 395402 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=395402&action=review > Source/WebKit/ChangeLog:12 > + - Remove MESSAGE_CHECK for `identifier` since decoding detects > + invalid values. Both the empty and deleted values for identifiers as hash table keys are prohibited/checked? Committed r259505: <https://trac.webkit.org/changeset/259505> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395402 [details]. > > Source/WebKit/ChangeLog:12
> > + - Remove MESSAGE_CHECK for `identifier` since decoding detects
> > + invalid values.
>
> Both the empty and deleted values for identifiers as hash table keys are
> prohibited/checked?
Looks like it:
template<typename Decoder> static Optional<ObjectIdentifier> decode(Decoder& decoder)
{
Optional<uint64_t> identifier;
decoder >> identifier;
if (!identifier || !isValidIdentifier(*identifier))
return WTF::nullopt;
return ObjectIdentifier { *identifier };
}
static bool isValidIdentifier(uint64_t identifier) { return identifier && identifier != hashTableDeletedValue(); }
|