Bug 224464

Summary: Remove SharedBuffer's equality operators with Ref<SharedBuffer>
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, jer.noble, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Alex Christensen 2021-04-12 17:19:09 PDT
Remove SharedBuffer's equality operators with Ref<SharedBuffer>
Comment 1 Alex Christensen 2021-04-12 17:21:26 PDT
Created attachment 425814 [details]
Patch
Comment 2 Chris Dumez 2021-04-12 17:43:58 PDT
Comment on attachment 425814 [details]
Patch

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

> Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:588
> +        if (anyOf(sessionKeys, [&](const Ref<SharedBuffer>& sessionKey) {

The new code looks worse?

What's wrong with comparing a Ref<> with a C++ reference? I can compare a RefPtr<> with a raw pointer already so why is this different?
Comment 3 Alex Christensen 2021-04-13 12:31:19 PDT
That's exactly what I'm trying to do in bug 224412 but can't until I do this.  This compares a Ref<SharedBuffer> and a SharedBuffer& by calling SharedBuffer::operator== which compares the bytes contained in the SharedBuffer's segments.  What I want is a pointer comparison, which is why I have to make these two call sites look worse before introducing a generic Ref equality operator without breaking them.
Comment 4 Chris Dumez 2021-04-13 12:33:17 PDT
Comment on attachment 425814 [details]
Patch

Oh, I missed that. Yes, I agree then.
Comment 5 EWS 2021-04-13 12:51:33 PDT
Committed r275900 (236465@main): <https://commits.webkit.org/236465@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425814 [details].
Comment 6 Radar WebKit Bug Importer 2021-04-13 12:52:14 PDT
<rdar://problem/76605767>