[Webkit-unassigned] [Bug 221767] New: Investigate creation and use of checked_objc_cast<>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 11 11:53:02 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=221767

            Bug ID: 221767
           Summary: Investigate creation and use of checked_objc_cast<>
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: darin at apple.com

Investigate creation and use of checked_objc_cast<>.

Via Darin Adler (paraphrasing): The dynamic_objc_cast<> method exists, but there may be some cases in WebKit where we actually want a checked_objc_cast<> method, similar to checked_cf_cast<>.

In a nutshell:
- Use checked_objc_cast<> if we always expect the same type of object (or nil), and it's obviously incorrect if a different (non-nil) object is referenced.
- Use dynamic_objc_cast<> if we're checking for a particular type, but it's not fatal if we get a different type.  The result of dynamic_objc_cast<> should always be nil-checked.

See also the discussion in Bug 221428 Comment #0 for the differences between checked_cf_cast<> and dynamic_cf_cast<>:
<https://bugs.webkit.org/show_bug.cgi?id=221428#c0>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210211/3e60304f/attachment-0001.htm>


More information about the webkit-unassigned mailing list