Add disconnect methods; cleanup DOM stuff (#2)

* Add disconnect methods

* Use Dom, not DomRoot

DomRoot will keep it permanently rooted, it should only be used in
values not on the JS heap
This commit is contained in:
Manish Goregaokar 2018-07-07 11:11:43 -07:00 committed by Fernando Jiménez Moreno
parent 23f7a73622
commit f3bc183dba
4 changed files with 34 additions and 29 deletions

View file

@ -11,7 +11,7 @@ use dom::bindings::codegen::Bindings::AudioNodeBinding::{ChannelCountMode, Chann
use dom::bindings::codegen::Bindings::GainNodeBinding::{self, GainNodeMethods, GainOptions};
use dom::bindings::error::Fallible;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::DomRoot;
use dom::bindings::root::{Dom, DomRoot};
use dom::window::Window;
use dom_struct::dom_struct;
use servo_media::audio::context::AudioContext;
@ -27,7 +27,7 @@ audio_param_impl!(Gain, GainNode, GainNodeMessage, SetGain);
#[dom_struct]
pub struct GainNode {
node: AudioNode,
gain: DomRoot<AudioParam>,
gain: Dom<AudioParam>,
}
impl GainNode {
@ -60,7 +60,7 @@ impl GainNode {
);
GainNode {
node,
gain
gain: Dom::from_ref(&gain),
}
}