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