| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 "cannot call stop without calling start first."); | 162 "cannot call stop without calling start first."); |
| 163 } else { | 163 } else { |
| 164 // stop() can be called more than once, with the last call to stop takin
g effect, unless the | 164 // stop() can be called more than once, with the last call to stop takin
g effect, unless the |
| 165 // source has already stopped due to earlier calls to stop. No exception
s are thrown in any | 165 // source has already stopped due to earlier calls to stop. No exception
s are thrown in any |
| 166 // case. | 166 // case. |
| 167 when = max(0.0, when); | 167 when = max(0.0, when); |
| 168 m_endTime = when; | 168 m_endTime = when; |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 void AudioScheduledSourceNode::setOnended(PassRefPtr<EventListener> listener, DO
MWrapperWorld* isolatedWorld) | 172 void AudioScheduledSourceNode::setOnended(PassRefPtr<EventListener> listener) |
| 173 { | 173 { |
| 174 m_hasEndedListener = listener; | 174 m_hasEndedListener = listener; |
| 175 setAttributeEventListener(EventTypeNames::ended, listener, isolatedWorld); | 175 setAttributeEventListener(EventTypeNames::ended, listener); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void AudioScheduledSourceNode::finish() | 178 void AudioScheduledSourceNode::finish() |
| 179 { | 179 { |
| 180 if (m_playbackState != FINISHED_STATE) { | 180 if (m_playbackState != FINISHED_STATE) { |
| 181 // Let the context dereference this AudioNode. | 181 // Let the context dereference this AudioNode. |
| 182 context()->notifyNodeFinishedProcessing(this); | 182 context()->notifyNodeFinishedProcessing(this); |
| 183 m_playbackState = FINISHED_STATE; | 183 m_playbackState = FINISHED_STATE; |
| 184 context()->decrementActiveSourceCount(); | 184 context()->decrementActiveSourceCount(); |
| 185 } | 185 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 206 void AudioScheduledSourceNode::NotifyEndedTask::notifyEnded() | 206 void AudioScheduledSourceNode::NotifyEndedTask::notifyEnded() |
| 207 { | 207 { |
| 208 RefPtr<Event> event = Event::create(EventTypeNames::ended); | 208 RefPtr<Event> event = Event::create(EventTypeNames::ended); |
| 209 event->setTarget(m_scheduledNode); | 209 event->setTarget(m_scheduledNode); |
| 210 m_scheduledNode->dispatchEvent(event.get()); | 210 m_scheduledNode->dispatchEvent(event.get()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace WebCore | 213 } // namespace WebCore |
| 214 | 214 |
| 215 #endif // ENABLE(WEB_AUDIO) | 215 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |