Index: third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp |
index 03c17f4ae1e05add492db138c2f3513f0e6fa186..be4f480e8222ba06ca4ec9ebb1a4df839c9072a6 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp |
@@ -130,7 +130,7 @@ |
return numberOfChannels() == desiredNumberOfChannels; |
} |
-DOMFloat32Array* AudioBuffer::createFloat32ArrayOrNull(size_t length) |
+PassRefPtr<DOMFloat32Array> AudioBuffer::createFloat32ArrayOrNull(size_t length) |
{ |
RefPtr<WTF::Float32Array> bufferView = WTF::Float32Array::createOrNull(length); |
if (!bufferView) |
@@ -145,11 +145,12 @@ |
m_channels.reserveCapacity(numberOfChannels); |
for (unsigned i = 0; i < numberOfChannels; ++i) { |
- DOMFloat32Array* channelDataArray = createFloat32ArrayOrNull(m_length); |
+ RefPtr<DOMFloat32Array> channelDataArray = createFloat32ArrayOrNull(m_length); |
// If the channel data array could not be created, just return. The caller will need to |
// check that the desired number of channels were created. |
- if (!channelDataArray) |
+ if (!channelDataArray) { |
return; |
+ } |
channelDataArray->setNeuterable(false); |
m_channels.append(channelDataArray); |
@@ -164,7 +165,7 @@ |
unsigned numberOfChannels = bus->numberOfChannels(); |
m_channels.reserveCapacity(numberOfChannels); |
for (unsigned i = 0; i < numberOfChannels; ++i) { |
- DOMFloat32Array* channelDataArray = createFloat32ArrayOrNull(m_length); |
+ RefPtr<DOMFloat32Array> channelDataArray = createFloat32ArrayOrNull(m_length); |
// If the channel data array could not be created, just return. The caller will need to |
// check that the desired number of channels were created. |
if (!channelDataArray) |
@@ -178,7 +179,7 @@ |
} |
} |
-DOMFloat32Array* AudioBuffer::getChannelData(unsigned channelIndex, ExceptionState& exceptionState) |
+PassRefPtr<DOMFloat32Array> AudioBuffer::getChannelData(unsigned channelIndex, ExceptionState& exceptionState) |
{ |
if (channelIndex >= m_channels.size()) { |
exceptionState.throwDOMException(IndexSizeError, "channel index (" + String::number(channelIndex) + ") exceeds number of channels (" + String::number(m_channels.size()) + ")"); |