Bug 1460907 - Implement AudioParamMap definitions. r=karlt,qdot

MozReview-Commit-ID: AdsI9QU3VOX

--HG--
extra : rebase_source : b72d898550289f0637d7cb1c9796a12a7b4fc782
This commit is contained in:
Arnaud Bienner 2018-05-13 16:16:23 +02:00
parent 0f7d120ed3
commit e1cac52f37
6 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,30 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "AudioParamMap.h"
#include "mozilla/dom/AudioParamMapBinding.h"
namespace mozilla {
namespace dom {
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AudioParamMap, mParent)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AudioParamMap, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AudioParamMap, Release)
AudioParamMap::AudioParamMap(nsPIDOMWindowInner* aParent) :
mParent(aParent)
{
}
JSObject*
AudioParamMap::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return AudioParamMapBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,38 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#ifndef AudioParamMap_h_
#define AudioParamMap_h_
#include "nsWrapperCache.h"
#include "nsCOMPtr.h"
class nsPIDOMWindowInner;
namespace mozilla {
namespace dom {
class AudioParamMap final : public nsWrapperCache
{
public:
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AudioParamMap)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioParamMap)
explicit AudioParamMap(nsPIDOMWindowInner* aParent);
nsPIDOMWindowInner* GetParentObject() const { return mParent; }
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
private:
~AudioParamMap() = default;
nsCOMPtr<nsPIDOMWindowInner> mParent;
};
} // namespace dom
} // namespace mozilla
#endif // AudioParamMap_h_

View File

@ -49,6 +49,7 @@ EXPORTS.mozilla.dom += [
'AudioListener.h',
'AudioNode.h',
'AudioParam.h',
'AudioParamMap.h',
'AudioProcessingEvent.h',
'AudioScheduledSourceNode.h',
'BiquadFilterNode.h',
@ -85,6 +86,7 @@ UNIFIED_SOURCES += [
'AudioNodeExternalInputStream.cpp',
'AudioNodeStream.cpp',
'AudioParam.cpp',
'AudioParamMap.cpp',
'AudioProcessingEvent.cpp',
'AudioScheduledSourceNode.cpp',
'BiquadFilterNode.cpp',

View File

@ -150,6 +150,8 @@ var interfaceNamesInGlobalScope =
{name: "AudioNode", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "AudioParam", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "AudioParamMap", insecureContext: true, disabled: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "AudioProcessingEvent", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -0,0 +1,16 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* https://webaudio.github.io/web-audio-api/#audioparammap
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
[Pref="dom.audioworklet.enabled"]
interface AudioParamMap {
readonly maplike<DOMString, AudioParam>;
};

View File

@ -379,6 +379,7 @@ WEBIDL_FILES = [
'AudioListener.webidl',
'AudioNode.webidl',
'AudioParam.webidl',
'AudioParamMap.webidl',
'AudioProcessingEvent.webidl',
'AudioScheduledSourceNode.webidl',
'AudioStreamTrack.webidl',