Bug 1265400 - Use unsigned long for AudioBuffer length and numberOfChannels; r?padenot
MozReview-Commit-ID: 47ZDDvj5QrA
--- a/dom/media/webaudio/AudioBuffer.h
+++ b/dom/media/webaudio/AudioBuffer.h
@@ -65,17 +65,17 @@ public:
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
float SampleRate() const
{
return mSampleRate;
}
- int32_t Length() const
+ uint32_t Length() const
{
return mLength;
}
double Duration() const
{
return mLength / static_cast<double> (mSampleRate);
}
--- a/dom/webidl/AudioBuffer.webidl
+++ b/dom/webidl/AudioBuffer.webidl
@@ -8,22 +8,22 @@
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface AudioBuffer {
readonly attribute float sampleRate;
- readonly attribute long length;
+ readonly attribute unsigned long length;
// in seconds
readonly attribute double duration;
- readonly attribute long numberOfChannels;
+ readonly attribute unsigned long numberOfChannels;
[Throws]
Float32Array getChannelData(unsigned long channel);
[Throws]
void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
[Throws]
void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);