Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/media/webaudio/GainNode.h
Line
Count
Source (jump to first uncovered line)
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/. */
6
7
#ifndef GainNode_h_
8
#define GainNode_h_
9
10
#include "AudioNode.h"
11
#include "AudioParam.h"
12
13
namespace mozilla {
14
namespace dom {
15
16
class AudioContext;
17
struct GainOptions;
18
19
class GainNode final : public AudioNode
20
{
21
public:
22
  static already_AddRefed<GainNode>
23
  Create(AudioContext& aAudioContext, const GainOptions& aOptions,
24
         ErrorResult& aRv);
25
26
  NS_DECL_ISUPPORTS_INHERITED
27
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(GainNode, AudioNode)
28
29
  static already_AddRefed<GainNode>
30
  Constructor(const GlobalObject& aGlobal, AudioContext& aAudioContext,
31
              const GainOptions& aOptions, ErrorResult& aRv)
32
  {
33
    return Create(aAudioContext, aOptions, aRv);
34
  }
35
36
  JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
37
38
  AudioParam* Gain() const
39
  {
40
    return mGain;
41
  }
42
43
  const char* NodeType() const override
44
0
  {
45
0
    return "GainNode";
46
0
  }
47
48
  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
49
  size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
50
51
private:
52
  explicit GainNode(AudioContext* aContext);
53
0
  ~GainNode() = default;
54
55
  RefPtr<AudioParam> mGain;
56
};
57
58
} // namespace dom
59
} // namespace mozilla
60
61
#endif