| 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 fe93007802e9839efc9bf0105a44c21df66c8356..f0dba1aaa289f185164105a17500feaeea92a024 100644
|
| --- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
|
| +++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
|
| @@ -54,10 +54,8 @@ const float kCentsPerRange = 1200 / kNumberOfOctaveBands;
|
| using namespace VectorMath;
|
|
|
| PeriodicWave* PeriodicWave::Create(BaseAudioContext& context,
|
| - size_t real_length,
|
| - const float* real,
|
| - size_t imag_length,
|
| - const float* imag,
|
| + const Vector<float>& real,
|
| + const Vector<float>& imag,
|
| bool disable_normalization,
|
| ExceptionState& exception_state) {
|
| DCHECK(IsMainThread());
|
| @@ -67,33 +65,21 @@ PeriodicWave* PeriodicWave::Create(BaseAudioContext& context,
|
| return nullptr;
|
| }
|
|
|
| - if (real_length != imag_length) {
|
| + if (real.size() != imag.size()) {
|
| exception_state.ThrowDOMException(
|
| kIndexSizeError, "length of real array (" +
|
| - String::Number(real_length) +
|
| + String::Number(real.size()) +
|
| ") and length of imaginary array (" +
|
| - String::Number(imag_length) + ") must match.");
|
| + String::Number(imag.size()) + ") must match.");
|
| return nullptr;
|
| }
|
|
|
| PeriodicWave* periodic_wave = new PeriodicWave(context.sampleRate());
|
| - periodic_wave->CreateBandLimitedTables(real, imag, real_length,
|
| + periodic_wave->CreateBandLimitedTables(real.Data(), imag.Data(), real.size(),
|
| disable_normalization);
|
| return periodic_wave;
|
| }
|
|
|
| -PeriodicWave* PeriodicWave::Create(BaseAudioContext& context,
|
| - NotShared<DOMFloat32Array> real,
|
| - NotShared<DOMFloat32Array> imag,
|
| - bool disable_normalization,
|
| - ExceptionState& exception_state) {
|
| - DCHECK(IsMainThread());
|
| -
|
| - return Create(context, real.View()->length(), real.View()->Data(),
|
| - imag.View()->length(), imag.View()->Data(),
|
| - disable_normalization, exception_state);
|
| -}
|
| -
|
| PeriodicWave* PeriodicWave::Create(BaseAudioContext* context,
|
| const PeriodicWaveOptions& options,
|
| ExceptionState& exception_state) {
|
| @@ -122,8 +108,7 @@ PeriodicWave* PeriodicWave::Create(BaseAudioContext* context,
|
| imag_coef[1] = 1;
|
| }
|
|
|
| - return Create(*context, real_coef.size(), real_coef.Data(), imag_coef.size(),
|
| - imag_coef.Data(), normalize, exception_state);
|
| + return Create(*context, real_coef, imag_coef, normalize, exception_state);
|
| }
|
|
|
| PeriodicWave* PeriodicWave::CreateSine(float sample_rate) {
|
|
|