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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 void AudioScheduledSourceHandler::notifyEnded() { | 230 void AudioScheduledSourceHandler::notifyEnded() { |
231 DCHECK(isMainThread()); | 231 DCHECK(isMainThread()); |
232 if (node()) | 232 if (node()) |
233 node()->dispatchEvent(Event::create(EventTypeNames::ended)); | 233 node()->dispatchEvent(Event::create(EventTypeNames::ended)); |
234 } | 234 } |
235 | 235 |
236 // ---------------------------------------------------------------- | 236 // ---------------------------------------------------------------- |
237 | 237 |
238 AudioScheduledSourceNode::AudioScheduledSourceNode(BaseAudioContext& context) | 238 AudioScheduledSourceNode::AudioScheduledSourceNode(BaseAudioContext& context) |
239 : AudioSourceNode(context), ActiveScriptWrappable(this) {} | 239 : AudioSourceNode(context), |
| 240 ActiveScriptWrappable<AudioScheduledSourceNode>(this) {} |
240 | 241 |
241 AudioScheduledSourceHandler& | 242 AudioScheduledSourceHandler& |
242 AudioScheduledSourceNode::audioScheduledSourceHandler() const { | 243 AudioScheduledSourceNode::audioScheduledSourceHandler() const { |
243 return static_cast<AudioScheduledSourceHandler&>(handler()); | 244 return static_cast<AudioScheduledSourceHandler&>(handler()); |
244 } | 245 } |
245 | 246 |
246 void AudioScheduledSourceNode::start(ExceptionState& exceptionState) { | 247 void AudioScheduledSourceNode::start(ExceptionState& exceptionState) { |
247 start(0, exceptionState); | 248 start(0, exceptionState); |
248 } | 249 } |
249 | 250 |
(...skipping 24 matching lines...) Expand all Loading... |
274 // playback state if the context is closed. | 275 // playback state if the context is closed. |
275 if (context()->isContextClosed()) | 276 if (context()->isContextClosed()) |
276 return false; | 277 return false; |
277 | 278 |
278 // If a node is scheduled or playing, do not collect the node prematurely | 279 // If a node is scheduled or playing, do not collect the node prematurely |
279 // even its reference is out of scope. Then fire onended event if assigned. | 280 // even its reference is out of scope. Then fire onended event if assigned. |
280 return audioScheduledSourceHandler().isPlayingOrScheduled(); | 281 return audioScheduledSourceHandler().isPlayingOrScheduled(); |
281 } | 282 } |
282 | 283 |
283 } // namespace blink | 284 } // namespace blink |
OLD | NEW |