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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp

Issue 2812833003: Revert of [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 return nullptr; 76 return nullptr;
77 } 77 }
78 78
79 PeriodicWave* periodic_wave = new PeriodicWave(context.sampleRate()); 79 PeriodicWave* periodic_wave = new PeriodicWave(context.sampleRate());
80 periodic_wave->CreateBandLimitedTables(real, imag, real_length, 80 periodic_wave->CreateBandLimitedTables(real, imag, real_length,
81 disable_normalization); 81 disable_normalization);
82 return periodic_wave; 82 return periodic_wave;
83 } 83 }
84 84
85 PeriodicWave* PeriodicWave::Create(BaseAudioContext& context, 85 PeriodicWave* PeriodicWave::Create(BaseAudioContext& context,
86 NotShared<DOMFloat32Array> real, 86 DOMFloat32Array* real,
87 NotShared<DOMFloat32Array> imag, 87 DOMFloat32Array* imag,
88 bool disable_normalization, 88 bool disable_normalization,
89 ExceptionState& exception_state) { 89 ExceptionState& exception_state) {
90 DCHECK(IsMainThread()); 90 DCHECK(IsMainThread());
91 91
92 return Create(context, real.View()->length(), real.View()->Data(), 92 return Create(context, real->length(), real->Data(), imag->length(),
93 imag.View()->length(), imag.View()->Data(), 93 imag->Data(), disable_normalization, exception_state);
94 disable_normalization, exception_state);
95 } 94 }
96 95
97 PeriodicWave* PeriodicWave::Create(BaseAudioContext* context, 96 PeriodicWave* PeriodicWave::Create(BaseAudioContext* context,
98 const PeriodicWaveOptions& options, 97 const PeriodicWaveOptions& options,
99 ExceptionState& exception_state) { 98 ExceptionState& exception_state) {
100 bool normalize = options.hasDisableNormalization() 99 bool normalize = options.hasDisableNormalization()
101 ? options.disableNormalization() 100 ? options.disableNormalization()
102 : false; 101 : false;
103 102
104 Vector<float> real_coef; 103 Vector<float> real_coef;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 397 }
399 398
400 real_p[n] = 0; 399 real_p[n] = 0;
401 imag_p[n] = b; 400 imag_p[n] = b;
402 } 401 }
403 402
404 CreateBandLimitedTables(real_p, imag_p, half_size, false); 403 CreateBandLimitedTables(real_p, imag_p, half_size, false);
405 } 404 }
406 405
407 } // namespace blink 406 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698