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

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

Issue 72363002: Rename es => exceptionState in other than bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Retry Created 7 years, 1 month 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
OLDNEW
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 memset(outputBus->channel(i)->mutableData() + zeroStartFrame, 0, sizeof(float) * framesToZero); 132 memset(outputBus->channel(i)->mutableData() + zeroStartFrame, 0, sizeof(float) * framesToZero);
133 } 133 }
134 134
135 finish(); 135 finish();
136 } 136 }
137 137
138 return; 138 return;
139 } 139 }
140 140
141 141
142 void AudioScheduledSourceNode::start(double when, ExceptionState& es) 142 void AudioScheduledSourceNode::start(double when, ExceptionState& exceptionState )
143 { 143 {
144 ASSERT(isMainThread()); 144 ASSERT(isMainThread());
145 145
146 if (m_playbackState != UNSCHEDULED_STATE) { 146 if (m_playbackState != UNSCHEDULED_STATE) {
147 es.throwDOMException( 147 exceptionState.throwDOMException(
148 InvalidStateError, 148 InvalidStateError,
149 ExceptionMessages::failedToExecute( 149 ExceptionMessages::failedToExecute(
150 "start", 150 "start",
151 "OscillatorNode", 151 "OscillatorNode",
152 "cannot call start more than once.")); 152 "cannot call start more than once."));
153 return; 153 return;
154 } 154 }
155 155
156 m_startTime = when; 156 m_startTime = when;
157 m_playbackState = SCHEDULED_STATE; 157 m_playbackState = SCHEDULED_STATE;
158 } 158 }
159 159
160 void AudioScheduledSourceNode::stop(double when, ExceptionState& es) 160 void AudioScheduledSourceNode::stop(double when, ExceptionState& exceptionState)
161 { 161 {
162 ASSERT(isMainThread()); 162 ASSERT(isMainThread());
163 163
164 if (m_stopCalled) { 164 if (m_stopCalled) {
165 es.throwDOMException( 165 exceptionState.throwDOMException(
166 InvalidStateError, 166 InvalidStateError,
167 ExceptionMessages::failedToExecute( 167 ExceptionMessages::failedToExecute(
168 "stop", 168 "stop",
169 "OscillatorNode", 169 "OscillatorNode",
170 "cannot call stop more than once.")); 170 "cannot call stop more than once."));
171 } else if (m_playbackState == UNSCHEDULED_STATE) { 171 } else if (m_playbackState == UNSCHEDULED_STATE) {
172 es.throwDOMException( 172 exceptionState.throwDOMException(
173 InvalidStateError, 173 InvalidStateError,
174 ExceptionMessages::failedToExecute( 174 ExceptionMessages::failedToExecute(
175 "stop", 175 "stop",
176 "OscillatorNode", 176 "OscillatorNode",
177 "cannot call stop without calling start first.")); 177 "cannot call stop without calling start first."));
178 } else { 178 } else {
179 // This can only happen from the SCHEDULED_STATE or PLAYING_STATE. The U NSCHEDULED_STATE is 179 // This can only happen from the SCHEDULED_STATE or PLAYING_STATE. The U NSCHEDULED_STATE is
180 // handled above, and the FINISHED_STATE is only reachable after stop() has been called, and 180 // handled above, and the FINISHED_STATE is only reachable after stop() has been called, and
181 // hence m_stopCalled is true. But that case is handled above. 181 // hence m_stopCalled is true. But that case is handled above.
182 when = max(0.0, when); 182 when = max(0.0, when);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void AudioScheduledSourceNode::NotifyEndedTask::notifyEnded() 222 void AudioScheduledSourceNode::NotifyEndedTask::notifyEnded()
223 { 223 {
224 RefPtr<Event> event = Event::create(EventTypeNames::ended); 224 RefPtr<Event> event = Event::create(EventTypeNames::ended);
225 event->setTarget(m_scheduledNode); 225 event->setTarget(m_scheduledNode);
226 m_scheduledNode->dispatchEvent(event.get()); 226 m_scheduledNode->dispatchEvent(event.get());
227 } 227 }
228 228
229 } // namespace WebCore 229 } // namespace WebCore
230 230
231 #endif // ENABLE(WEB_AUDIO) 231 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioScheduledSourceNode.h ('k') | Source/modules/webaudio/DefaultAudioDestinationNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698