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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/PeriodicWave.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 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return nullptr; 75 return nullptr;
76 } 76 }
77 77
78 PeriodicWave* periodicWave = new PeriodicWave(context.sampleRate()); 78 PeriodicWave* periodicWave = new PeriodicWave(context.sampleRate());
79 periodicWave->createBandLimitedTables(real, imag, realLength, 79 periodicWave->createBandLimitedTables(real, imag, realLength,
80 disableNormalization); 80 disableNormalization);
81 return periodicWave; 81 return periodicWave;
82 } 82 }
83 83
84 PeriodicWave* PeriodicWave::create(BaseAudioContext& context, 84 PeriodicWave* PeriodicWave::create(BaseAudioContext& context,
85 DOMFloat32Array* real, 85 const NotShared<DOMFloat32Array>& real,
86 DOMFloat32Array* imag, 86 const NotShared<DOMFloat32Array>& imag,
87 bool disableNormalization, 87 bool disableNormalization,
88 ExceptionState& exceptionState) { 88 ExceptionState& exceptionState) {
89 DCHECK(isMainThread()); 89 DCHECK(isMainThread());
90 90
91 return create(context, real->length(), real->data(), imag->length(), 91 return create(context, real.view()->length(), real.view()->data(),
92 imag->data(), disableNormalization, exceptionState); 92 imag.view()->length(), imag.view()->data(),
93 disableNormalization, exceptionState);
93 } 94 }
94 95
95 PeriodicWave* PeriodicWave::create(BaseAudioContext* context, 96 PeriodicWave* PeriodicWave::create(BaseAudioContext* context,
96 const PeriodicWaveOptions& options, 97 const PeriodicWaveOptions& options,
97 ExceptionState& exceptionState) { 98 ExceptionState& exceptionState) {
98 bool normalize = options.hasDisableNormalization() 99 bool normalize = options.hasDisableNormalization()
99 ? options.disableNormalization() 100 ? options.disableNormalization()
100 : false; 101 : false;
101 102
102 Vector<float> realCoef; 103 Vector<float> realCoef;
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 396 }
396 397
397 realP[n] = 0; 398 realP[n] = 0;
398 imagP[n] = b; 399 imagP[n] = b;
399 } 400 }
400 401
401 createBandLimitedTables(realP, imagP, halfSize, false); 402 createBandLimitedTables(realP, imagP, halfSize, false);
402 } 403 }
403 404
404 } // namespace blink 405 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698