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

Side by Side Diff: Source/modules/webaudio/ConvolverNode.cpp

Issue 1074463003: Return after throwing an exception when ConvolerNode.buffer rate is wrong. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 if (!buffer) 118 if (!buffer)
119 return; 119 return;
120 120
121 if (buffer->sampleRate() != context()->sampleRate()) { 121 if (buffer->sampleRate() != context()->sampleRate()) {
122 exceptionState.throwDOMException( 122 exceptionState.throwDOMException(
123 NotSupportedError, 123 NotSupportedError,
124 "The buffer sample rate of " + String::number(buffer->sampleRate()) 124 "The buffer sample rate of " + String::number(buffer->sampleRate())
125 + " does not match the context rate of " + String::number(context()- >sampleRate()) 125 + " does not match the context rate of " + String::number(context()- >sampleRate())
126 + " Hz."); 126 + " Hz.");
127 return;
127 } 128 }
128 129
129 unsigned numberOfChannels = buffer->numberOfChannels(); 130 unsigned numberOfChannels = buffer->numberOfChannels();
130 size_t bufferLength = buffer->length(); 131 size_t bufferLength = buffer->length();
131 132
132 // The current implementation supports up to four channel impulse responses, which are interpreted as true-stereo (see Reverb class). 133 // The current implementation supports up to four channel impulse responses, which are interpreted as true-stereo (see Reverb class).
133 bool isBufferGood = numberOfChannels > 0 && numberOfChannels <= 4 && bufferL ength; 134 bool isBufferGood = numberOfChannels > 0 && numberOfChannels <= 4 && bufferL ength;
134 ASSERT(isBufferGood); 135 ASSERT(isBufferGood);
135 if (!isBufferGood) 136 if (!isBufferGood)
136 return; 137 return;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 222 }
222 223
223 void ConvolverNode::setNormalize(bool normalize) 224 void ConvolverNode::setNormalize(bool normalize)
224 { 225 {
225 convolverHandler().setNormalize(normalize); 226 convolverHandler().setNormalize(normalize);
226 } 227 }
227 228
228 } // namespace blink 229 } // namespace blink
229 230
230 #endif // ENABLE(WEB_AUDIO) 231 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698