Backed out changeset 06f41c22f3a6 (bug 1888460) for causing linux xpcshell failures...
[gecko.git] / dom / media / webaudio / MediaStreamAudioDestinationNode.h
blob24923955dfdce1d07724815b362a4f739aad3afb
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MediaStreamAudioDestinationNode_h_
8 #define MediaStreamAudioDestinationNode_h_
10 #include "AudioNode.h"
12 namespace mozilla::dom {
14 class AudioContext;
15 struct AudioNodeOptions;
17 class MediaStreamAudioDestinationNode final : public AudioNode {
18 public:
19 static already_AddRefed<MediaStreamAudioDestinationNode> Create(
20 AudioContext& aAudioContext, const AudioNodeOptions& aOptions,
21 ErrorResult& aRv);
23 NS_DECL_ISUPPORTS_INHERITED
24 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamAudioDestinationNode,
25 AudioNode)
27 static already_AddRefed<MediaStreamAudioDestinationNode> Constructor(
28 const GlobalObject& aGlobal, AudioContext& aAudioContext,
29 const AudioNodeOptions& aOptions, ErrorResult& aRv) {
30 return Create(aAudioContext, aOptions, aRv);
33 JSObject* WrapObject(JSContext* aCx,
34 JS::Handle<JSObject*> aGivenProto) override;
36 uint16_t NumberOfOutputs() const final { return 0; }
38 void DestroyMediaTrack() override;
40 DOMMediaStream* DOMStream() const { return mDOMStream; }
42 const char* NodeType() const override {
43 return "MediaStreamAudioDestinationNode";
46 size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
47 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
49 private:
50 explicit MediaStreamAudioDestinationNode(AudioContext* aContext);
51 ~MediaStreamAudioDestinationNode() = default;
53 RefPtr<DOMMediaStream> mDOMStream;
56 } // namespace mozilla::dom
58 #endif