Rationale:
1) Using a traits class to define safe casts lets us use a standard way of checking for whether a downcast is safe: IsA<Subclass>. While most Blink classes expose virtuals like IsSubclass(), that's not universally true--and sometimes the type checking method is unusually named, or is done with an enum type tag, et cetera.
2) This removes some confusion around the "OrNull" variant: it's easy to think that the "OrNull" variant needs to be used when the input could be null: in fact, it's perfectly safe to downcast with To<> if the input is null (even if it's a bit odd).
3) It's not a macro?
Along the way, also update code to use DynamicTo for checking the subclass + and downcasting to it.
Comment 1 by bugdroid1@chromium.org
, Oct 3