/src/mozilla-central/dom/worklet/AudioWorkletGlobalScope.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 http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "AudioWorkletGlobalScope.h" |
8 | | #include "WorkletPrincipal.h" |
9 | | #include "mozilla/dom/AudioWorkletGlobalScopeBinding.h" |
10 | | #include "mozilla/dom/FunctionBinding.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | |
15 | | AudioWorkletGlobalScope::AudioWorkletGlobalScope() |
16 | | : mCurrentFrame(0) |
17 | | , mCurrentTime(0) |
18 | | , mSampleRate(0.0) |
19 | 0 | {} |
20 | | |
21 | | bool |
22 | | AudioWorkletGlobalScope::WrapGlobalObject(JSContext* aCx, |
23 | | JS::MutableHandle<JSObject*> aReflector) |
24 | 0 | { |
25 | 0 | JS::RealmOptions options; |
26 | 0 | return AudioWorkletGlobalScope_Binding::Wrap(aCx, this, this, |
27 | 0 | options, |
28 | 0 | WorkletPrincipal::GetWorkletPrincipal(), |
29 | 0 | true, aReflector); |
30 | 0 | } |
31 | | |
32 | | void |
33 | | AudioWorkletGlobalScope::RegisterProcessor(const nsAString& aType, |
34 | | VoidFunction& aProcessorCtor) |
35 | 0 | { |
36 | 0 | // Nothing to do here. |
37 | 0 | } |
38 | | |
39 | | uint64_t AudioWorkletGlobalScope::CurrentFrame() const |
40 | 0 | { |
41 | 0 | return mCurrentFrame; |
42 | 0 | } |
43 | | |
44 | | double AudioWorkletGlobalScope::CurrentTime() const |
45 | 0 | { |
46 | 0 | return mCurrentTime; |
47 | 0 | } |
48 | | |
49 | | float AudioWorkletGlobalScope::SampleRate() const |
50 | 0 | { |
51 | 0 | return mSampleRate; |
52 | 0 | } |
53 | | |
54 | | } // dom namespace |
55 | | } // mozilla namespace |