Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 #include "modules/webaudio/IIRFilterNode.h" | 53 #include "modules/webaudio/IIRFilterNode.h" |
| 54 #include "modules/webaudio/MediaElementAudioSourceNode.h" | 54 #include "modules/webaudio/MediaElementAudioSourceNode.h" |
| 55 #include "modules/webaudio/MediaStreamAudioDestinationNode.h" | 55 #include "modules/webaudio/MediaStreamAudioDestinationNode.h" |
| 56 #include "modules/webaudio/MediaStreamAudioSourceNode.h" | 56 #include "modules/webaudio/MediaStreamAudioSourceNode.h" |
| 57 #include "modules/webaudio/OfflineAudioCompletionEvent.h" | 57 #include "modules/webaudio/OfflineAudioCompletionEvent.h" |
| 58 #include "modules/webaudio/OfflineAudioContext.h" | 58 #include "modules/webaudio/OfflineAudioContext.h" |
| 59 #include "modules/webaudio/OfflineAudioDestinationNode.h" | 59 #include "modules/webaudio/OfflineAudioDestinationNode.h" |
| 60 #include "modules/webaudio/OscillatorNode.h" | 60 #include "modules/webaudio/OscillatorNode.h" |
| 61 #include "modules/webaudio/PannerNode.h" | 61 #include "modules/webaudio/PannerNode.h" |
| 62 #include "modules/webaudio/PeriodicWave.h" | 62 #include "modules/webaudio/PeriodicWave.h" |
| 63 #include "modules/webaudio/PeriodicWaveConstraints.h" | |
| 63 #include "modules/webaudio/ScriptProcessorNode.h" | 64 #include "modules/webaudio/ScriptProcessorNode.h" |
| 64 #include "modules/webaudio/StereoPannerNode.h" | 65 #include "modules/webaudio/StereoPannerNode.h" |
| 65 #include "modules/webaudio/WaveShaperNode.h" | 66 #include "modules/webaudio/WaveShaperNode.h" |
| 66 #include "platform/ThreadSafeFunctional.h" | 67 #include "platform/ThreadSafeFunctional.h" |
| 67 #include "platform/audio/IIRFilter.h" | 68 #include "platform/audio/IIRFilter.h" |
| 68 #include "public/platform/Platform.h" | 69 #include "public/platform/Platform.h" |
| 69 #include "wtf/text/WTFString.h" | 70 #include "wtf/text/WTFString.h" |
| 70 | 71 |
| 71 namespace blink { | 72 namespace blink { |
| 72 | 73 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 // called. | 572 // called. |
| 572 | 573 |
| 573 return node; | 574 return node; |
| 574 } | 575 } |
| 575 | 576 |
| 576 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO MFloat32Array* imag, ExceptionState& exceptionState) | 577 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO MFloat32Array* imag, ExceptionState& exceptionState) |
| 577 { | 578 { |
| 578 return PeriodicWave::create(sampleRate(), real, imag, false); | 579 return PeriodicWave::create(sampleRate(), real, imag, false); |
| 579 } | 580 } |
| 580 | 581 |
| 581 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO MFloat32Array* imag, const Dictionary& options, ExceptionState& exceptionState) | 582 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO MFloat32Array* imag, const PeriodicWaveConstraints& options, ExceptionState& exc eptionState) |
| 582 { | 583 { |
| 583 ASSERT(isMainThread()); | 584 ASSERT(isMainThread()); |
| 584 | 585 |
| 585 if (isContextClosed()) { | 586 if (isContextClosed()) { |
| 586 throwExceptionForClosedState(exceptionState); | 587 throwExceptionForClosedState(exceptionState); |
| 587 return nullptr; | 588 return nullptr; |
| 588 } | 589 } |
| 589 | 590 |
| 590 if (real->length() != imag->length()) { | 591 if (real->length() != imag->length()) { |
| 591 exceptionState.throwDOMException( | 592 exceptionState.throwDOMException( |
| 592 IndexSizeError, | 593 IndexSizeError, |
| 593 "length of real array (" + String::number(real->length()) | 594 "length of real array (" + String::number(real->length()) |
| 594 + ") and length of imaginary array (" + String::number(imag->length ()) | 595 + ") and length of imaginary array (" + String::number(imag->length ()) |
| 595 + ") must match."); | 596 + ") must match."); |
| 596 return nullptr; | 597 return nullptr; |
| 597 } | 598 } |
| 598 | 599 |
| 599 bool isNormalizationDisabled = false; | 600 bool isNormalizationDisabled = false; |
| 600 DictionaryHelper::getWithUndefinedOrNullCheck(options, "disableNormalization ", isNormalizationDisabled); | 601 if (options.hasDisableNormalization()) |
|
Rick Byers
2016/05/05 14:13:39
nit: since this is a required dictionary member (w
Raymond Toy
2016/05/05 17:11:46
Done. Removed the default value from the IDL was
| |
| 602 isNormalizationDisabled = options.disableNormalization(); | |
| 601 | 603 |
| 602 return PeriodicWave::create(sampleRate(), real, imag, isNormalizationDisable d); | 604 return PeriodicWave::create(sampleRate(), real, imag, isNormalizationDisable d); |
| 603 } | 605 } |
| 604 | 606 |
| 605 IIRFilterNode* AbstractAudioContext::createIIRFilter(Vector<double> feedforwardC oef, Vector<double> feedbackCoef, ExceptionState& exceptionState) | 607 IIRFilterNode* AbstractAudioContext::createIIRFilter(Vector<double> feedforwardC oef, Vector<double> feedbackCoef, ExceptionState& exceptionState) |
| 606 { | 608 { |
| 607 ASSERT(isMainThread()); | 609 ASSERT(isMainThread()); |
| 608 | 610 |
| 609 if (isContextClosed()) { | 611 if (isContextClosed()) { |
| 610 throwExceptionForClosedState(exceptionState); | 612 throwExceptionForClosedState(exceptionState); |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 962 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const | 964 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const |
| 963 { | 965 { |
| 964 if (getExecutionContext()) | 966 if (getExecutionContext()) |
| 965 return getExecutionContext()->getSecurityOrigin(); | 967 return getExecutionContext()->getSecurityOrigin(); |
| 966 | 968 |
| 967 return nullptr; | 969 return nullptr; |
| 968 } | 970 } |
| 969 | 971 |
| 970 } // namespace blink | 972 } // namespace blink |
| 971 | 973 |
| OLD | NEW |