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

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

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: remove unused checks Created 3 years, 8 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 294a59f0536253049358697418b8dfca28c54bce..cc89ce9dd09aa51ddf5a7efd2d0971419389b841 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp
@@ -203,13 +203,13 @@ DOMFloat32Array* AudioBuffer::getChannelData(unsigned channelIndex) {
return m_channels[channelIndex].get();
}
-void AudioBuffer::copyFromChannel(DOMFloat32Array* destination,
+void AudioBuffer::copyFromChannel(const NotShared<DOMFloat32Array>& destination,
haraken 2017/04/06 08:43:54 Would it be possible to make NotShared<> be passed
binji 2017/04/09 00:40:02 Done.
long channelNumber,
ExceptionState& exceptionState) {
return copyFromChannel(destination, channelNumber, 0, exceptionState);
}
-void AudioBuffer::copyFromChannel(DOMFloat32Array* destination,
+void AudioBuffer::copyFromChannel(const NotShared<DOMFloat32Array>& destination,
long channelNumber,
unsigned long startInChannel,
ExceptionState& exceptionState) {
@@ -238,10 +238,10 @@ void AudioBuffer::copyFromChannel(DOMFloat32Array* destination,
}
unsigned count = channelData->length() - startInChannel;
- count = std::min(destination->length(), count);
+ count = std::min(destination.view()->length(), count);
const float* src = channelData->data();
- float* dst = destination->data();
+ float* dst = destination.view()->data();
DCHECK(src);
DCHECK(dst);
@@ -249,13 +249,13 @@ void AudioBuffer::copyFromChannel(DOMFloat32Array* destination,
memcpy(dst, src + startInChannel, count * sizeof(*src));
}
-void AudioBuffer::copyToChannel(DOMFloat32Array* source,
+void AudioBuffer::copyToChannel(const NotShared<DOMFloat32Array>& source,
long channelNumber,
ExceptionState& exceptionState) {
return copyToChannel(source, channelNumber, 0, exceptionState);
}
-void AudioBuffer::copyToChannel(DOMFloat32Array* source,
+void AudioBuffer::copyToChannel(const NotShared<DOMFloat32Array>& source,
long channelNumber,
unsigned long startInChannel,
ExceptionState& exceptionState) {
@@ -284,9 +284,9 @@ void AudioBuffer::copyToChannel(DOMFloat32Array* source,
}
unsigned count = channelData->length() - startInChannel;
- count = std::min(source->length(), count);
+ count = std::min(source.view()->length(), count);
- const float* src = source->data();
+ const float* src = source.view()->data();
float* dst = channelData->data();
DCHECK(src);

Powered by Google App Engine
This is Rietveld 408576698