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

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

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | « Source/modules/speech/SpeechRecognition.cpp ('k') | Source/modules/webaudio/AudioContext.cpp » ('j') | 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 * 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 void AudioBuffer::releaseMemory() 89 void AudioBuffer::releaseMemory()
90 { 90 {
91 m_channels.clear(); 91 m_channels.clear();
92 } 92 }
93 93
94 Float32Array* AudioBuffer::getChannelData(unsigned channelIndex, ExceptionCode& ec) 94 Float32Array* AudioBuffer::getChannelData(unsigned channelIndex, ExceptionCode& ec)
95 { 95 {
96 if (channelIndex >= m_channels.size()) { 96 if (channelIndex >= m_channels.size()) {
97 ec = SYNTAX_ERR; 97 ec = SyntaxError;
98 return 0; 98 return 0;
99 } 99 }
100 100
101 return m_channels[channelIndex].get(); 101 return m_channels[channelIndex].get();
102 } 102 }
103 103
104 Float32Array* AudioBuffer::getChannelData(unsigned channelIndex) 104 Float32Array* AudioBuffer::getChannelData(unsigned channelIndex)
105 { 105 {
106 if (channelIndex >= m_channels.size()) 106 if (channelIndex >= m_channels.size())
107 return 0; 107 return 0;
108 108
109 return m_channels[channelIndex].get(); 109 return m_channels[channelIndex].get();
110 } 110 }
111 111
112 void AudioBuffer::zero() 112 void AudioBuffer::zero()
113 { 113 {
114 for (unsigned i = 0; i < m_channels.size(); ++i) { 114 for (unsigned i = 0; i < m_channels.size(); ++i) {
115 if (getChannelData(i)) 115 if (getChannelData(i))
116 getChannelData(i)->zeroRange(0, length()); 116 getChannelData(i)->zeroRange(0, length());
117 } 117 }
118 } 118 }
119 119
120 } // namespace WebCore 120 } // namespace WebCore
121 121
122 #endif // ENABLE(WEB_AUDIO) 122 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/speech/SpeechRecognition.cpp ('k') | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698