| 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 * 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 "number of channels", | 60 "number of channels", |
| 61 numberOfChannels, | 61 numberOfChannels, |
| 62 0, | 62 0, |
| 63 ExceptionMessages::InclusiveBound, | 63 ExceptionMessages::InclusiveBound, |
| 64 AudioContext::maxNumberOfChannels(), | 64 AudioContext::maxNumberOfChannels(), |
| 65 ExceptionMessages::InclusiveBound)); | 65 ExceptionMessages::InclusiveBound)); |
| 66 return nullptr; | 66 return nullptr; |
| 67 } | 67 } |
| 68 | 68 |
| 69 if (!isSampleRateRangeGood(sampleRate)) { | 69 if (!isSampleRateRangeGood(sampleRate)) { |
| 70 exceptionState.throwDOMException(SyntaxError, "sample rate (" + String::
number(sampleRate) + ") must be in the range 44100-96000 Hz."); | 70 exceptionState.throwDOMException(SyntaxError, "sample rate (" + String::
number(sampleRate) + ") must be in the range 22050-96000 Hz."); |
| 71 return nullptr; | 71 return nullptr; |
| 72 } | 72 } |
| 73 | 73 |
| 74 RefPtrWillBeRawPtr<OfflineAudioContext> audioContext(adoptRefWillBeThreadSaf
eRefCountedGarbageCollected(new OfflineAudioContext(document, numberOfChannels,
numberOfFrames, sampleRate))); | 74 RefPtrWillBeRawPtr<OfflineAudioContext> audioContext(adoptRefWillBeThreadSaf
eRefCountedGarbageCollected(new OfflineAudioContext(document, numberOfChannels,
numberOfFrames, sampleRate))); |
| 75 | 75 |
| 76 if (!audioContext->destination()) { | 76 if (!audioContext->destination()) { |
| 77 exceptionState.throwDOMException( | 77 exceptionState.throwDOMException( |
| 78 NotSupportedError, | 78 NotSupportedError, |
| 79 "OfflineAudioContext(" + String::number(numberOfChannels) | 79 "OfflineAudioContext(" + String::number(numberOfChannels) |
| 80 + ", " + String::number(numberOfFrames) | 80 + ", " + String::number(numberOfFrames) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 92 ScriptWrappable::init(this); | 92 ScriptWrappable::init(this); |
| 93 } | 93 } |
| 94 | 94 |
| 95 OfflineAudioContext::~OfflineAudioContext() | 95 OfflineAudioContext::~OfflineAudioContext() |
| 96 { | 96 { |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace WebCore | 99 } // namespace WebCore |
| 100 | 100 |
| 101 #endif // ENABLE(WEB_AUDIO) | 101 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |