mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 775302 - Stub out the implementation of mozAudioContext; r=bzbarsky,khuey
This commit is contained in:
parent
55ec4303a5
commit
4ccf1a400c
@ -62,6 +62,8 @@ CPPSRCS += \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
PARALLEL_DIRS += webaudio
|
||||
|
||||
ifdef MOZ_RAW
|
||||
PARALLEL_DIRS += raw
|
||||
endif
|
||||
|
56
content/media/webaudio/AudioContext.cpp
Normal file
56
content/media/webaudio/AudioContext.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* 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/. */
|
||||
|
||||
#include "AudioContext.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/dom/AudioContextBinding.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(AudioContext, mWindow)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(AudioContext)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(AudioContext)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AudioContext)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
AudioContext::AudioContext(nsIDOMWindow* aWindow)
|
||||
: mWindow(aWindow)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
AudioContext::~AudioContext()
|
||||
{
|
||||
}
|
||||
|
||||
JSObject*
|
||||
AudioContext::WrapObject(JSContext* aCx, JSObject* aScope,
|
||||
bool* aTriedToWrap)
|
||||
{
|
||||
return dom::mozAudioContextBinding::Wrap(aCx, aScope, this,
|
||||
aTriedToWrap);
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<AudioContext>
|
||||
AudioContext::Constructor(nsISupports* aGlobal, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(aGlobal);
|
||||
if (!window) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AudioContext* object = new AudioContext(window);
|
||||
NS_ADDREF(object);
|
||||
return object;
|
||||
}
|
||||
|
||||
}
|
||||
|
46
content/media/webaudio/AudioContext.h
Normal file
46
content/media/webaudio/AudioContext.h
Normal file
@ -0,0 +1,46 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* 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/. */
|
||||
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class JSContext;
|
||||
class nsIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class ErrorResult;
|
||||
|
||||
class AudioContext MOZ_FINAL : public nsISupports,
|
||||
public nsWrapperCache
|
||||
{
|
||||
explicit AudioContext(nsIDOMWindow* aParentWindow);
|
||||
|
||||
public:
|
||||
virtual ~AudioContext();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AudioContext)
|
||||
|
||||
nsIDOMWindow* GetParentObject() const
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope,
|
||||
bool* aTriedToWrap);
|
||||
|
||||
static already_AddRefed<AudioContext>
|
||||
Constructor(nsISupports* aGlobal, ErrorResult& aRv);
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDOMWindow> mWindow;
|
||||
};
|
||||
|
||||
}
|
||||
|
25
content/media/webaudio/Makefile.in
Normal file
25
content/media/webaudio/Makefile.in
Normal file
@ -0,0 +1,25 @@
|
||||
# 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/.
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
FAIL_ON_WARNINGS := 1
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE := content
|
||||
LIBRARY_NAME := gkconwebaudio_s
|
||||
LIBXUL_LIBRARY := 1
|
||||
|
||||
CPPSRCS := \
|
||||
AudioContext.cpp
|
||||
$(NULL)
|
||||
|
||||
PARALLEL_DIRS := test
|
||||
|
||||
FORCE_STATIC_LIB := 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
17
content/media/webaudio/test/Makefile.in
Normal file
17
content/media/webaudio/test/Makefile.in
Normal file
@ -0,0 +1,17 @@
|
||||
# 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/.
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
relativesrcdir := @relativesrcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_AudioContext.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
22
content/media/webaudio/test/test_AudioContext.html
Normal file
22
content/media/webaudio/test/test_AudioContext.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test whether we can create an AudioContext interface</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
var ac = new mozAudioContext();
|
||||
ok(ac, "Create a mozAudioContext object");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -61,6 +61,11 @@
|
||||
|
||||
DOMInterfaces = {
|
||||
|
||||
'mozAudioContext': {
|
||||
'nativeType': 'AudioContext',
|
||||
'prefable': True,
|
||||
},
|
||||
|
||||
'Blob': [
|
||||
{
|
||||
'headerFile': 'nsIDOMFile.h',
|
||||
|
@ -25,6 +25,7 @@ DOM_SRCDIRS = \
|
||||
content/base/src \
|
||||
content/html/content/src \
|
||||
content/html/document/src \
|
||||
content/media/webaudio \
|
||||
content/svg/content/src \
|
||||
layout/generic \
|
||||
layout/style \
|
||||
|
16
dom/webidl/AudioContext.webidl
Normal file
16
dom/webidl/AudioContext.webidl
Normal 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://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
[Constructor]
|
||||
interface mozAudioContext {
|
||||
};
|
||||
|
@ -9,6 +9,7 @@ generated_webidl_files = \
|
||||
$(NULL)
|
||||
|
||||
webidl_files = \
|
||||
AudioContext.webidl \
|
||||
CanvasRenderingContext2D.webidl \
|
||||
CSSStyleDeclaration.webidl \
|
||||
Function.webidl \
|
||||
|
@ -134,6 +134,7 @@ endif #}
|
||||
ifdef MOZ_MEDIA
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DEPTH)/content/media/$(LIB_PREFIX)gkconmedia_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/content/media/webaudio/$(LIB_PREFIX)gkconwebaudio_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/content/media/webrtc/$(LIB_PREFIX)gkconwebrtc_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user