| OLD | NEW |
| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 ExceptionState& exceptionState) { | 62 ExceptionState& exceptionState) { |
| 63 DCHECK(isMainThread()); | 63 DCHECK(isMainThread()); |
| 64 | 64 |
| 65 if (context.isContextClosed()) { | 65 if (context.isContextClosed()) { |
| 66 context.throwExceptionForClosedState(exceptionState); | 66 context.throwExceptionForClosedState(exceptionState); |
| 67 return nullptr; | 67 return nullptr; |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (realLength != imagLength) { | 70 if (realLength != imagLength) { |
| 71 exceptionState.throwDOMException( | 71 exceptionState.throwDOMException( |
| 72 IndexSizeError, "length of real array (" + String::number(realLength) + | 72 IndexSizeError, |
| 73 ") and length of imaginary array (" + | 73 "length of real array (" + String::number(realLength) + |
| 74 String::number(imagLength) + ") must match."); | 74 ") and length of imaginary array (" + String::number(imagLength) + |
| 75 ") must match."); |
| 75 return nullptr; | 76 return nullptr; |
| 76 } | 77 } |
| 77 | 78 |
| 78 PeriodicWave* periodicWave = new PeriodicWave(context.sampleRate()); | 79 PeriodicWave* periodicWave = new PeriodicWave(context.sampleRate()); |
| 79 periodicWave->createBandLimitedTables(real, imag, realLength, | 80 periodicWave->createBandLimitedTables(real, imag, realLength, |
| 80 disableNormalization); | 81 disableNormalization); |
| 81 return periodicWave; | 82 return periodicWave; |
| 82 } | 83 } |
| 83 | 84 |
| 84 PeriodicWave* PeriodicWave::create(BaseAudioContext& context, | 85 PeriodicWave* PeriodicWave::create(BaseAudioContext& context, |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 398 } |
| 398 | 399 |
| 399 realP[n] = 0; | 400 realP[n] = 0; |
| 400 imagP[n] = b; | 401 imagP[n] = b; |
| 401 } | 402 } |
| 402 | 403 |
| 403 createBandLimitedTables(realP, imagP, halfSize, false); | 404 createBandLimitedTables(realP, imagP, halfSize, false); |
| 404 } | 405 } |
| 405 | 406 |
| 406 } // namespace blink | 407 } // namespace blink |
| OLD | NEW |