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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Let the context dereference this AudioNode. | 202 // Let the context dereference this AudioNode. |
203 context()->notifySourceNodeFinishedProcessing(this); | 203 context()->notifySourceNodeFinishedProcessing(this); |
204 setPlaybackState(FINISHED_STATE); | 204 setPlaybackState(FINISHED_STATE); |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 void AudioScheduledSourceHandler::finish() | 208 void AudioScheduledSourceHandler::finish() |
209 { | 209 { |
210 finishWithoutOnEnded(); | 210 finishWithoutOnEnded(); |
211 | 211 |
212 if (context()->executionContext()) { | 212 if (context()->getExecutionContext()) { |
213 context()->executionContext()->postTask(BLINK_FROM_HERE, createCrossThre
adTask(&AudioScheduledSourceHandler::notifyEnded, PassRefPtr<AudioScheduledSourc
eHandler>(this))); | 213 context()->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossT
hreadTask(&AudioScheduledSourceHandler::notifyEnded, PassRefPtr<AudioScheduledSo
urceHandler>(this))); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 void AudioScheduledSourceHandler::notifyEnded() | 217 void AudioScheduledSourceHandler::notifyEnded() |
218 { | 218 { |
219 ASSERT(isMainThread()); | 219 ASSERT(isMainThread()); |
220 if (node()) | 220 if (node()) |
221 node()->dispatchEvent(Event::create(EventTypeNames::ended)); | 221 node()->dispatchEvent(Event::create(EventTypeNames::ended)); |
222 } | 222 } |
223 | 223 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (context()->isContextClosed()) | 270 if (context()->isContextClosed()) |
271 return false; | 271 return false; |
272 | 272 |
273 // If a node is scheduled or playing, do not collect the node prematurely | 273 // If a node is scheduled or playing, do not collect the node prematurely |
274 // even its reference is out of scope. Then fire onended event if assigned. | 274 // even its reference is out of scope. Then fire onended event if assigned. |
275 return audioScheduledSourceHandler().isPlayingOrScheduled(); | 275 return audioScheduledSourceHandler().isPlayingOrScheduled(); |
276 } | 276 } |
277 | 277 |
278 } // namespace blink | 278 } // namespace blink |
279 | 279 |
OLD | NEW |