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

Side by Side Diff: Source/modules/webaudio/DefaultAudioDestinationNode.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/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/OfflineAudioContext.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) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex ceptionCode& ec) 112 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex ceptionCode& ec)
113 { 113 {
114 // The channelCount for the input to this node controls the actual number of channels we 114 // The channelCount for the input to this node controls the actual number of channels we
115 // send to the audio hardware. It can only be set depending on the maximum n umber of 115 // send to the audio hardware. It can only be set depending on the maximum n umber of
116 // channels supported by the hardware. 116 // channels supported by the hardware.
117 117
118 ASSERT(isMainThread()); 118 ASSERT(isMainThread());
119 119
120 if (!maxChannelCount() || channelCount > maxChannelCount()) { 120 if (!maxChannelCount() || channelCount > maxChannelCount()) {
121 ec = INVALID_STATE_ERR; 121 ec = InvalidStateError;
122 return; 122 return;
123 } 123 }
124 124
125 unsigned long oldChannelCount = this->channelCount(); 125 unsigned long oldChannelCount = this->channelCount();
126 AudioNode::setChannelCount(channelCount, ec); 126 AudioNode::setChannelCount(channelCount, ec);
127 127
128 if (!ec && this->channelCount() != oldChannelCount && isInitialized()) { 128 if (!ec && this->channelCount() != oldChannelCount && isInitialized()) {
129 // Re-create destination. 129 // Re-create destination.
130 m_destination->stop(); 130 m_destination->stop();
131 createDestination(); 131 createDestination();
132 m_destination->start(); 132 m_destination->start();
133 } 133 }
134 } 134 }
135 135
136 } // namespace WebCore 136 } // namespace WebCore
137 137
138 #endif // ENABLE(WEB_AUDIO) 138 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/OfflineAudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698