Bug 136773

Summary: [Meta] Type cast by using toFoo()
Product: WebKit Reporter: Gyuyoung Kim <gyuyoung.kim>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 136809, 136403, 136609, 136628, 136766, 136774, 136775    
Bug Blocks:    

Description Gyuyoung Kim 2014-09-11 23:19:04 PDT
As I announced in https://lists.webkit.org/pipermail/webkit-dev/2013-September/025532.html, this bug is to track bugs which changes to use toFoo() instead of static_cast<>.

To use toFoo() for type casting, there are below benefits,

 - Bad type cast can be detected by using ASSERTION in toFoo(). The
toFoo() function has an ASSERTION to check if source value is a proper
super class.
 - Unnecessary local variables can be removed. There are some local
variables, which are only used once in WebKit. In those cases, we don’t
need to use a local variable. Besides, we can remove unnecessary ASSERTION
because toFoo() already has it.
 - I believe toFoo() can improve code readability.