See bug 980506 for an extensive discussion about this. This patch adds
three APIs to AudioNode in order for us to be able to build awesome
devtools on top of it.
* Weak reference API.
This patch allows one to hold a weak reference to all AudioNode's
using Components.utils.getWeakReference(). That way, the devtool's
inspection code would not change the lifetime of AudioNodes.
* AudioNode.id
This is a chrome-only unique and monotonically incrementing ID for
AudioNode objects. It is supposed to be used in order for the
devtools to be able to identify a node without having to keep it
alive.
* webaudio-node-demise
This is an observer notification that is called every time an
AudioNode gets destroyed inside Gecko. The ID of the corresponding
node is passed to this notification.
--HG--
extra : rebase_source : 83246a990489daf44ddc97dd4ea372a8cebe8e00
See bug 980506 for an extensive discussion about this. This patch adds
three APIs to AudioNode in order for us to be able to build awesome
devtools on top of it.
* Weak reference API.
This patch allows one to hold a weak reference to all AudioNode's
using Components.utils.getWeakReference(). That way, the devtool's
inspection code would not change the lifetime of AudioNodes.
* AudioNode.id
This is a chrome-only unique and monotonically incrementing ID for
AudioNode objects. It is supposed to be used in order for the
devtools to be able to identify a node without having to keep it
alive.
* webaudio-node-demise
This is an observer notification that is called every time an
AudioNode gets destroyed inside Gecko. The ID of the corresponding
node is passed to this notification.
This patch was mostly generated with the following command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e '/WrapObject(JSContext/ {; N; s/\(WrapObject(JSContext *\* *a\{0,1\}[Cc]x\),\n\{0,1\} *JS::Handle<JSObject\*> a\{0,1\}[sS]cope/\1/ ; }' -i ""
and then reverting the changes that made to
dom/bindings/BindingUtils.h, since those WrapObject methods are not
the ones we're trying to change here, plus a bunch of manual fixups
for cases that this command did not catch (including all the callsites
of WrapObject()).
This patch was mostly generated with this command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""
plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.