зеркало из https://github.com/mozilla/gecko-dev.git
7e5a37a024
The basic idea for the changes around UnwrapObjectInternal and its callers (UnwrapObject, UNWRAP_OBJECT, etc) is to add a parameter to the guts of the object-unwrapping code in bindings which can be either a JSContext* or nullptr (statically typed). Then we test which type it is and do either a CheckedUnwrapDynamic or CheckedUnwrapStatic. Since the type is known at compile time, there is no actual runtime check; the compiler just emits a call to the right thing directly (verified by examining the assembly output on Linux). The rest of the changes are mostly propagating through that template parameter, adding static asserts to make sure people don't accidentally pass nullptr while trying to unwrap to a type that might be a WindowProxy or Location, etc. There are also some changes to places that were calling CheckedUnwrap directly to use either the static or dynamic version, as needed. Differential Revision: https://phabricator.services.mozilla.com/D17883 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
moz.build | ||
xptcodegen.py | ||
xptinfo.cpp | ||
xptinfo.h |