/src/mozilla-central/dom/media/webaudio/AudioWorkletProcessor.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
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 https://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "AudioWorkletProcessor.h" |
8 | | |
9 | | #include "mozilla/dom/AudioWorkletNodeBinding.h" |
10 | | #include "mozilla/dom/AudioWorkletProcessorBinding.h" |
11 | | #include "mozilla/dom/MessagePort.h" |
12 | | #include "nsIGlobalObject.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AudioWorkletProcessor, mParent) |
18 | | |
19 | | NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AudioWorkletProcessor, AddRef) |
20 | | NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AudioWorkletProcessor, Release) |
21 | | |
22 | | AudioWorkletProcessor::AudioWorkletProcessor(nsIGlobalObject* aParent) |
23 | | : mParent(aParent) |
24 | 0 | { |
25 | 0 | } |
26 | | |
27 | | /* static */ already_AddRefed<AudioWorkletProcessor> |
28 | | AudioWorkletProcessor::Constructor(const GlobalObject& aGlobal, |
29 | | const AudioWorkletNodeOptions& aOptions, |
30 | | ErrorResult& aRv) |
31 | 0 | { |
32 | 0 | nsCOMPtr<nsIGlobalObject> global = |
33 | 0 | do_QueryInterface(aGlobal.GetAsSupports()); |
34 | 0 | MOZ_ASSERT(global); |
35 | 0 |
|
36 | 0 | RefPtr<AudioWorkletProcessor> audioWorkletProcessor = |
37 | 0 | new AudioWorkletProcessor(global); |
38 | 0 |
|
39 | 0 | return audioWorkletProcessor.forget(); |
40 | 0 | } |
41 | | |
42 | | JSObject* |
43 | | AudioWorkletProcessor::WrapObject(JSContext* aCx, |
44 | | JS::Handle<JSObject*> aGivenProto) |
45 | 0 | { |
46 | 0 | return AudioWorkletProcessor_Binding::Wrap(aCx, this, aGivenProto); |
47 | 0 | } |
48 | | |
49 | | MessagePort* |
50 | | AudioWorkletProcessor::GetPort(ErrorResult& aRv) const |
51 | 0 | { |
52 | 0 | aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
53 | 0 | return nullptr; |
54 | 0 | } |
55 | | |
56 | | } // namespace dom |
57 | | } // namespace mozilla |