Diff
Modified: trunk/Source/WebCore/ChangeLog (103881 => 103882)
--- trunk/Source/WebCore/ChangeLog 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/ChangeLog 2012-01-01 20:56:27 UTC (rev 103882)
@@ -1,3 +1,24 @@
+2012-01-01 Raymond Liu <[email protected]>
+
+ Use overload methods to implement [Optional] parameters in AudioNode.idl
+ https://bugs.webkit.org/show_bug.cgi?id=75402
+
+ Reviewed by Adam Barth.
+
+ No new tests required.
+
+ * GNUmakefile.list.am:
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSAudioNodeCustom.cpp: Removed.
+ * bindings/v8/custom/V8AudioNodeCustom.cpp: Removed.
+ * webaudio/AudioNode.cpp:
+ (WebCore::AudioNode::connect):
+ (WebCore::AudioNode::disconnect):
+ * webaudio/AudioNode.h:
+ * webaudio/AudioNode.idl:
+
2011-12-20 Robert Hogan <[email protected]>
CSS 2.1 failure: border-collapse-offset-002.htm fails
Modified: trunk/Source/WebCore/GNUmakefile.list.am (103881 => 103882)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-01-01 20:56:27 UTC (rev 103882)
@@ -5200,7 +5200,6 @@
webcore_sources += \
Source/WebCore/bindings/js/JSAudioBufferSourceNodeCustom.cpp \
Source/WebCore/bindings/js/JSAudioContextCustom.cpp \
- Source/WebCore/bindings/js/JSAudioNodeCustom.cpp \
Source/WebCore/bindings/js/JSConvolverNodeCustom.cpp \
Source/WebCore/bindings/js/JSJavaScriptAudioNodeCustom.cpp \
Source/WebCore/bindings/js/JSWaveShaperNodeCustom.cpp \
Modified: trunk/Source/WebCore/UseV8.cmake (103881 => 103882)
--- trunk/Source/WebCore/UseV8.cmake 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/UseV8.cmake 2012-01-01 20:56:27 UTC (rev 103882)
@@ -67,7 +67,6 @@
bindings/v8/custom/V8ArrayBufferCustom.cpp
bindings/v8/custom/V8ArrayBufferViewCustom.cpp
bindings/v8/custom/V8AudioContextCustom.cpp
- bindings/v8/custom/V8AudioNodeCustom.cpp
bindings/v8/custom/V8CSSRuleCustom.cpp
bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
bindings/v8/custom/V8CSSStyleSheetCustom.cpp
Modified: trunk/Source/WebCore/WebCore.gypi (103881 => 103882)
--- trunk/Source/WebCore/WebCore.gypi 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/WebCore.gypi 2012-01-01 20:56:27 UTC (rev 103882)
@@ -1820,7 +1820,6 @@
'bindings/js/JSAttrCustom.cpp',
'bindings/js/JSAudioBufferSourceNodeCustom.cpp',
'bindings/js/JSAudioContextCustom.cpp',
- 'bindings/js/JSAudioNodeCustom.cpp',
'bindings/js/JSBindingsAllInOne.cpp',
'bindings/js/JSCDATASectionCustom.cpp',
'bindings/js/JSCSSFontFaceRuleCustom.cpp',
@@ -2180,7 +2179,6 @@
'bindings/v8/custom/V8ArrayBufferViewCustom.h',
'bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp',
'bindings/v8/custom/V8AudioContextCustom.cpp',
- 'bindings/v8/custom/V8AudioNodeCustom.cpp',
'bindings/v8/custom/V8BindingMacros.h',
'bindings/v8/custom/V8CSSRuleCustom.cpp',
'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp',
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (103881 => 103882)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-01-01 20:56:27 UTC (rev 103882)
@@ -6380,7 +6380,6 @@
FDC54F051399B0DA008D9117 /* BiquadFilterNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FDC54F021399B0DA008D9117 /* BiquadFilterNode.h */; };
FDEAAAF312B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAEF12B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp */; };
FDEAAAF412B02EE400DCF33B /* JSAudioContextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAF012B02EE400DCF33B /* JSAudioContextCustom.cpp */; };
- FDEAAAF512B02EE400DCF33B /* JSAudioNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAF112B02EE400DCF33B /* JSAudioNodeCustom.cpp */; };
FDEAAAF612B02EE400DCF33B /* JSConvolverNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAF212B02EE400DCF33B /* JSConvolverNodeCustom.cpp */; };
FDEAAAFE12B02F4900DCF33B /* JSJavaScriptAudioNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDEAAAFD12B02F4900DCF33B /* JSJavaScriptAudioNodeCustom.cpp */; };
FDF09DC81399B62200688E5B /* JSBiquadFilterNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDF09DC61399B62200688E5B /* JSBiquadFilterNode.cpp */; };
@@ -13859,7 +13858,6 @@
FDC54F031399B0DA008D9117 /* BiquadFilterNode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BiquadFilterNode.idl; sourceTree = "<group>"; };
FDEAAAEF12B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioBufferSourceNodeCustom.cpp; sourceTree = "<group>"; };
FDEAAAF012B02EE400DCF33B /* JSAudioContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioContextCustom.cpp; sourceTree = "<group>"; };
- FDEAAAF112B02EE400DCF33B /* JSAudioNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioNodeCustom.cpp; sourceTree = "<group>"; };
FDEAAAF212B02EE400DCF33B /* JSConvolverNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSConvolverNodeCustom.cpp; sourceTree = "<group>"; };
FDEAAAFD12B02F4900DCF33B /* JSJavaScriptAudioNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJavaScriptAudioNodeCustom.cpp; sourceTree = "<group>"; };
FDF09DC61399B62200688E5B /* JSBiquadFilterNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBiquadFilterNode.cpp; sourceTree = "<group>"; };
@@ -19830,7 +19828,6 @@
BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
FDEAAAEF12B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp */,
FDEAAAF012B02EE400DCF33B /* JSAudioContextCustom.cpp */,
- FDEAAAF112B02EE400DCF33B /* JSAudioNodeCustom.cpp */,
49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
49EED14D1051971A00099FAB /* JSCanvasRenderingContextCustom.cpp */,
93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */,
@@ -26325,7 +26322,6 @@
FDA15EAB12B03EE1003A583A /* JSAudioGainNode.cpp in Sources */,
FDA15EAD12B03EE1003A583A /* JSAudioListener.cpp in Sources */,
FDA15EAF12B03EE1003A583A /* JSAudioNode.cpp in Sources */,
- FDEAAAF512B02EE400DCF33B /* JSAudioNodeCustom.cpp in Sources */,
FDA15EB112B03EE1003A583A /* JSAudioPannerNode.cpp in Sources */,
FDA15EB312B03EE1003A583A /* JSAudioParam.cpp in Sources */,
FDA15EB512B03EE1003A583A /* JSAudioProcessingEvent.cpp in Sources */,
Deleted: trunk/Source/WebCore/bindings/js/JSAudioNodeCustom.cpp (103881 => 103882)
--- trunk/Source/WebCore/bindings/js/JSAudioNodeCustom.cpp 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/bindings/js/JSAudioNodeCustom.cpp 2012-01-01 20:56:27 UTC (rev 103882)
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2010, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_AUDIO)
-
-#include "JSAudioNode.h"
-
-#include "AudioNode.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-JSC::JSValue JSAudioNode::connect(JSC::ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return throwError(exec, createSyntaxError(exec, "Not enough arguments"));
-
- unsigned outputIndex = 0;
- unsigned inputIndex = 0;
-
- AudioNode* destinationNode = toAudioNode(exec->argument(0));
- if (!destinationNode)
- return throwError(exec, createSyntaxError(exec, "Invalid destination node"));
-
- if (exec->argumentCount() > 1)
- outputIndex = exec->argument(1).toInt32(exec);
-
- if (exec->argumentCount() > 2)
- inputIndex = exec->argument(2).toInt32(exec);
-
- AudioNode* audioNode = static_cast<AudioNode*>(impl());
- bool success = audioNode->connect(destinationNode, outputIndex, inputIndex);
- if (!success)
- return throwError(exec, createSyntaxError(exec, "Invalid index parameter"));
-
- return JSC::jsUndefined();
-}
-
-JSC::JSValue JSAudioNode::disconnect(JSC::ExecState* exec)
-{
- unsigned outputIndex = 0;
- if (exec->argumentCount() > 0)
- outputIndex = exec->argument(0).toInt32(exec);
-
- AudioNode* audioNode = static_cast<AudioNode*>(impl());
- audioNode->disconnect(outputIndex);
- return JSC::jsUndefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_AUDIO)
Deleted: trunk/Source/WebCore/bindings/v8/custom/V8AudioNodeCustom.cpp (103881 => 103882)
--- trunk/Source/WebCore/bindings/v8/custom/V8AudioNodeCustom.cpp 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/bindings/v8/custom/V8AudioNodeCustom.cpp 2012-01-01 20:56:27 UTC (rev 103882)
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2010, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_AUDIO)
-
-#include "V8AudioNode.h"
-
-#include "AudioNode.h"
-#include "ExceptionCode.h"
-#include "NotImplemented.h"
-#include "V8Binding.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8AudioNode::connectCallback(const v8::Arguments& args)
-{
- if (args.Length() < 1)
- return throwError("Not enough arguments", V8Proxy::SyntaxError);
-
- AudioNode* destinationNode = 0;
- if (V8AudioNode::HasInstance(args[0]))
- destinationNode = toNative(args[0]->ToObject());
-
- if (!destinationNode)
- return throwError("Invalid destination node", V8Proxy::SyntaxError);
-
- unsigned output = 0;
- unsigned input = 0;
- bool ok = false;
- if (args.Length() > 1) {
- output = toInt32(args[1], ok);
- if (!ok)
- return throwError("Invalid index parameters", V8Proxy::SyntaxError);
- }
-
- if (args.Length() > 2) {
- input = toInt32(args[2], ok);
- if (!ok)
- return throwError("Invalid index parameters", V8Proxy::SyntaxError);
- }
-
- AudioNode* audioNode = toNative(args.Holder());
- bool success = audioNode->connect(destinationNode, output, input);
- if (!success)
- return throwError("Invalid index parameter", V8Proxy::SyntaxError);
-
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8AudioNode::disconnectCallback(const v8::Arguments& args)
-{
- unsigned output = 0;
- bool ok = false;
- if (args.Length() > 0) {
- output = toInt32(args[0], ok);
- if (!ok)
- return throwError("Invalid index parameters", V8Proxy::SyntaxError);
- }
-
- AudioNode* audioNode = toNative(args.Holder());
- bool success = audioNode->disconnect(output);
- if (!success)
- return throwError("Invalid index parameter", V8Proxy::SyntaxError);
-
- return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_AUDIO)
Modified: trunk/Source/WebCore/webaudio/AudioNode.cpp (103881 => 103882)
--- trunk/Source/WebCore/webaudio/AudioNode.cpp 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/webaudio/AudioNode.cpp 2012-01-01 20:56:27 UTC (rev 103882)
@@ -31,6 +31,7 @@
#include "AudioContext.h"
#include "AudioNodeInput.h"
#include "AudioNodeOutput.h"
+#include "ExceptionCode.h"
#include <wtf/Atomics.h>
#include <wtf/MainThread.h>
@@ -113,42 +114,53 @@
return 0;
}
-bool AudioNode::connect(AudioNode* destination, unsigned outputIndex, unsigned inputIndex)
+void AudioNode::connect(AudioNode* destination, unsigned outputIndex, unsigned inputIndex, ExceptionCode& ec)
{
ASSERT(isMainThread());
AudioContext::AutoLocker locker(context());
-
- // Sanity check input and output indices.
- if (outputIndex >= numberOfOutputs())
- return false;
- if (destination && inputIndex >= destination->numberOfInputs())
- return false;
- AudioNodeOutput* output = this->output(outputIndex);
if (!destination) {
- // Disconnect output from any inputs it may be currently connected to.
- output->disconnectAllInputs();
- return true;
+ ec = SYNTAX_ERR;
+ return;
}
-
- if (context() != destination->context())
- return false;
+ // Sanity check input and output indices.
+ if (outputIndex >= numberOfOutputs()) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ if (destination && inputIndex >= destination->numberOfInputs()) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ if (context() != destination->context()) {
+ ec = SYNTAX_ERR;
+ return;
+ }
+
AudioNodeInput* input = destination->input(inputIndex);
+ AudioNodeOutput* output = this->output(outputIndex);
input->connect(output);
// Let context know that a connection has been made.
context()->incrementConnectionCount();
-
- return true;
}
-bool AudioNode::disconnect(unsigned outputIndex)
+void AudioNode::disconnect(unsigned outputIndex, ExceptionCode& ec)
{
ASSERT(isMainThread());
AudioContext::AutoLocker locker(context());
-
- return connect(0, outputIndex);
+
+ // Sanity check input and output indices.
+ if (outputIndex >= numberOfOutputs()) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ AudioNodeOutput* output = this->output(outputIndex);
+ output->disconnectAllInputs();
}
void AudioNode::processIfNecessary(size_t framesToProcess)
Modified: trunk/Source/WebCore/webaudio/AudioNode.h (103881 => 103882)
--- trunk/Source/WebCore/webaudio/AudioNode.h 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/webaudio/AudioNode.h 2012-01-01 20:56:27 UTC (rev 103882)
@@ -38,6 +38,8 @@
class AudioNodeInput;
class AudioNodeOutput;
+typedef int ExceptionCode;
+
// An AudioNode is the basic building block for handling audio within an AudioContext.
// It may be an audio source, an intermediate processing module, or an audio destination.
// Each AudioNode can have inputs and/or outputs. An AudioSourceNode has no inputs and a single output.
@@ -112,10 +114,9 @@
AudioNodeInput* input(unsigned);
AudioNodeOutput* output(unsigned);
- // connect() / disconnect() return true on success.
// Called from main thread by corresponding _javascript_ methods.
- bool connect(AudioNode* destination, unsigned outputIndex = 0, unsigned inputIndex = 0);
- bool disconnect(unsigned outputIndex = 0);
+ void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, ExceptionCode&);
+ void disconnect(unsigned outputIndex, ExceptionCode&);
float sampleRate() const { return m_sampleRate; }
Modified: trunk/Source/WebCore/webaudio/AudioNode.idl (103881 => 103882)
--- trunk/Source/WebCore/webaudio/AudioNode.idl 2012-01-01 20:12:52 UTC (rev 103881)
+++ trunk/Source/WebCore/webaudio/AudioNode.idl 2012-01-01 20:56:27 UTC (rev 103882)
@@ -30,12 +30,10 @@
readonly attribute unsigned long numberOfInputs;
readonly attribute unsigned long numberOfOutputs;
- // FIXME: Why does this method need to be Custom?
- [Custom] void connect(in AudioNode destination, in [Optional] unsigned long output, in [Optional] unsigned long input)
+ void connect(in AudioNode destination, in [Optional=CallWithDefaultValue] unsigned long output, in [Optional=CallWithDefaultValue] unsigned long input)
raises(DOMException);
- // FIXME: Why does this method need to be Custom?
- [Custom] void disconnect(in [Optional] unsigned long output)
+ void disconnect(in [Optional=CallWithDefaultValue] unsigned long output)
raises(DOMException);
};
}