Bug 230467

Summary: Replace dynamic_objc_cast<> with dynamic_ns_cast<>
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Web Template FrameworkAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: CLOSED WONTFIX    
Severity: Normal CC: benjamin, cdumez, changseok, cmarcelo, darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, jer.noble, kondapallykalyan, pdr, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230508
Bug Depends on: 139893, 139915, 230227    
Bug Blocks:    
Attachments:
Description Flags
Patch v1 none

Description David Kilzer (:ddkilzer) 2021-09-19 13:30:29 PDT
Replace dynamic_objc_cast<> with dynamic_ns_cast<>.

dynamic_objc_cast<> was originally added for Bug 139893 in r177677, then moved to WTF for Bug 139915 in r177697.

dynamic_ns_cast<> was added for Bug 230227 in r282703 as part of <wtf/cocoa/TypeCastsNS.h>.

Since TypeCastsNS.h has an rvalue overload of dynamic_ns_cast<> and contains checked_ns_cast<> and has tests and is two characters less to type, let's replace dynamic_objc_cast<> with dynamic_ns_cast<>.

(Sorry Anders.)
Comment 1 David Kilzer (:ddkilzer) 2021-09-19 13:34:57 PDT
NOTE: There is internal code that uses dynamic_objc_cast<>, so that has to be updated before this lands.
Comment 2 Radar WebKit Bug Importer 2021-09-19 13:48:04 PDT
<rdar://problem/83287321>
Comment 3 David Kilzer (:ddkilzer) 2021-09-19 14:05:32 PDT
Created attachment 438619 [details]
Patch v1
Comment 4 David Kilzer (:ddkilzer) 2021-09-20 07:56:41 PDT
Comment on attachment 438619 [details]
Patch v1

In Bug 230406, Darin writes:

> Did you see my comment about dynamic_objc_cast? I think I prefer that name to dynamic_ns_cast.

So I'll either flip this, or close it and file a new bug.
Comment 5 David Kilzer (:ddkilzer) 2021-09-20 08:12:33 PDT
(In reply to David Kilzer (:ddkilzer) from comment #4)
> Comment on attachment 438619 [details]
> Patch v1
> 
> In Bug 230406, Darin writes:
> 
> > Did you see my comment about dynamic_objc_cast? I think I prefer that name to dynamic_ns_cast.
> 
> So I'll either flip this, or close it and file a new bug.

Moving this to RESOLVED/WONTFIX.
Comment 6 David Kilzer (:ddkilzer) 2021-09-20 14:01:49 PDT
(In reply to David Kilzer (:ddkilzer) from comment #4)
> Comment on attachment 438619 [details]
> Patch v1
> 
> In Bug 230406, Darin writes:
> 
> > Did you see my comment about dynamic_objc_cast? I think I prefer that name to dynamic_ns_cast.
> 
> So I'll either flip this, or close it and file a new bug.

Bug 230508: Rename {checked,dynamic}_ns_cast<> to {checked,dynamic}_objc_cast<>