Using callbacks and observers in the bindings is confusing (and sometimes broken) |
|||||
Issue description
It seems doing:
callback interface X {
handleEvent(...);
}
[Custom]
callback interface X {
handleEvent(...);
}
callback interface X {
[Custom] handleEvent(...);
}
callback Foo = void ();
[Custom] callback Foo = void ();
All generate subtlety different code, and almost all users are actually creating custom bindings of them. The non custom version of callbacks appears to actually be broken (See issue 658086 ).
There's a bunch of callbacks now, and also observer interfaces
IntersectionObserver => [Custom] callback, CustomConstructor on observer.
ResizeObserver => regular callback interface with [Custom] void handleEvent, no custom observer.
PerformanceObserver => nothing custom (this is broken today).
MutationObserver => CustomConstructor(MutationCallback), confusingly MutationCallback is not defined in idl at all, and is totally in C++ as custom code. It seems the idl compiler didn't type check the inputs, it probably should and yell when you pass something that's undefined.
IDBObserver => callback, CustomConstructor (this is broken today).
,
Oct 21 2016
,
Oct 21 2016
lkawai@ (an intern) already implemented callback functions in the IDL compiler. All the weird custom bindings are going to be replaced with the generated callback functions.
,
Oct 21 2016
Issue 569301 is supposed to fix callback functions. Last I checked, all callback interfaces except EventListener should actually be callback functions. (NodeFilter should also be a callback interface, but is currently weird.)
,
Oct 25 2016
IIUC callback function support is almost done except for lifetime handing. Those callback interfaces should be replaced with callback functions, but I think it's better to do that after issue 468240 is resolved. Without wrapper-tracing, we have to write custom bindings anyway.
,
Nov 1 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by esprehn@chromium.org
, Oct 21 2016