Chromium Code Reviews
DescriptionRemove custom signatures from V8 bindings
- Previously custom signatures were specified on methods that have parameters whose type is a DOM object. For example:
void foo(bool a, bool b, Node node); // This method has a custom signature because Node is a DOM object.
- Custom signatures were used by V8 to validate the parameter type when the method is called back. However, it is a responsibility of (not V8 but) V8 binding to validate the parameter type. In fact, V8 binding already generates code for the validation. For example:
Node* node = V8Node::hasInstance(args[2]) ? V8Node::toNative(args[2]) : 0;
- Thus, custom signatures are unnecessary. This CL removes the custom signatures completely.
- The only thing we have to be careful about is DOMWindow. Because DOMWindow has a hidden prototype chain, we cannot validate the parameter type just by checking V8Window::hasInstance(). Thus this CL adds toNativeDOMWindow() that looks up the prototype chain and finds an instance on the hidden prototype chain.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164407
Patch Set 1 #
Messages
Total messages: 4 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||