Index: third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp |
index d55f92cb1be9ce48800ab23a2fc2785b7c136972..5e24ff553bef183865a195ebb96e8bedf887acd7 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp |
@@ -81,13 +81,22 @@ PeriodicWave* PeriodicWave::create(BaseAudioContext& context, |
return periodicWave; |
} |
-PeriodicWave* PeriodicWave::create(BaseAudioContext& context, |
- DOMFloat32Array* real, |
- DOMFloat32Array* imag, |
- bool disableNormalization, |
- ExceptionState& exceptionState) { |
+PeriodicWave* PeriodicWave::create( |
+ BaseAudioContext& context, |
+ const MaybeShared<DOMFloat32Array>& realMaybeShared, |
+ const MaybeShared<DOMFloat32Array>& imagMaybeShared, |
+ bool disableNormalization, |
+ ExceptionState& exceptionState) { |
DCHECK(isMainThread()); |
+ if (realMaybeShared.isShared() || imagMaybeShared.isShared()) { |
+ exceptionState.throwTypeError( |
+ "real and imag should not be backed by a SharedArrayBuffer."); |
+ return nullptr; |
+ } |
+ DOMFloat32Array* real = realMaybeShared.viewNotShared(); |
+ DOMFloat32Array* imag = imagMaybeShared.viewNotShared(); |
+ |
return create(context, real->length(), real->data(), imag->length(), |
imag->data(), disableNormalization, exceptionState); |
} |