/src/mozilla-central/dom/media/webaudio/AudioWorkletProcessor.h
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 | | #ifndef AudioWorkletProcessor_h_ |
8 | | #define AudioWorkletProcessor_h_ |
9 | | |
10 | | #include "nsCOMPtr.h" |
11 | | #include "nsWrapperCache.h" |
12 | | |
13 | | struct AudioWorkletNodeOptions; |
14 | | class ErrorResult; |
15 | | class GlobalObject; |
16 | | class MessagePort; |
17 | | class nsIGlobalObject; |
18 | | |
19 | | namespace mozilla { |
20 | | namespace dom { |
21 | | |
22 | | class AudioWorkletProcessor final : public nsWrapperCache |
23 | | { |
24 | | public: |
25 | | NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AudioWorkletProcessor) |
26 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioWorkletProcessor) |
27 | | |
28 | | static already_AddRefed<AudioWorkletProcessor> |
29 | | Constructor(const GlobalObject& aGlobal, |
30 | | const AudioWorkletNodeOptions& aOptions, |
31 | | ErrorResult& aRv); |
32 | | |
33 | | nsIGlobalObject* GetParentObject() const { return mParent; } |
34 | | |
35 | | JSObject* WrapObject(JSContext* aCx, |
36 | | JS::Handle<JSObject*> aGivenProto) override; |
37 | | |
38 | | MessagePort* GetPort(ErrorResult& aRv) const; |
39 | | |
40 | | private: |
41 | | explicit AudioWorkletProcessor(nsIGlobalObject* aParent); |
42 | 0 | ~AudioWorkletProcessor() = default; |
43 | | nsCOMPtr<nsIGlobalObject> mParent; |
44 | | }; |
45 | | |
46 | | |
47 | | } // namespace dom |
48 | | } // namespace mozilla |
49 | | |
50 | | #endif // AudioWorkletProcessor_h_ |