Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()) + ")");

Powered by Google App Engine
This is Rietveld 408576698