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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 HandleStoppableSourceNodes(); | 381 HandleStoppableSourceNodes(); |
382 | 382 |
383 return ShouldSuspend(); | 383 return ShouldSuspend(); |
384 } | 384 } |
385 | 385 |
386 void OfflineAudioContext::HandlePostOfflineRenderTasks() { | 386 void OfflineAudioContext::HandlePostOfflineRenderTasks() { |
387 DCHECK(IsAudioThread()); | 387 DCHECK(IsAudioThread()); |
388 | 388 |
389 // OfflineGraphAutoLocker here locks the audio graph for the same reason | 389 // OfflineGraphAutoLocker here locks the audio graph for the same reason |
390 // above in |handlePreOfflineRenderTasks|. | 390 // above in |handlePreOfflineRenderTasks|. |
391 bool did_remove = false; | |
392 { | 391 { |
393 OfflineGraphAutoLocker locker(this); | 392 OfflineGraphAutoLocker locker(this); |
394 | 393 |
395 GetDeferredTaskHandler().BreakConnections(); | 394 GetDeferredTaskHandler().BreakConnections(); |
396 did_remove = ReleaseFinishedSourceNodes(); | |
397 GetDeferredTaskHandler().HandleDeferredTasks(); | 395 GetDeferredTaskHandler().HandleDeferredTasks(); |
398 GetDeferredTaskHandler().RequestToDeleteHandlersOnMainThread(); | 396 GetDeferredTaskHandler().RequestToDeleteHandlersOnMainThread(); |
399 } | 397 } |
400 | |
401 RemoveFinishedSourceNodes(did_remove); | |
402 } | 398 } |
403 | 399 |
404 OfflineAudioDestinationHandler& OfflineAudioContext::DestinationHandler() { | 400 OfflineAudioDestinationHandler& OfflineAudioContext::DestinationHandler() { |
405 return static_cast<OfflineAudioDestinationHandler&>( | 401 return static_cast<OfflineAudioDestinationHandler&>( |
406 destination()->GetAudioDestinationHandler()); | 402 destination()->GetAudioDestinationHandler()); |
407 } | 403 } |
408 | 404 |
409 void OfflineAudioContext::ResolveSuspendOnMainThread(size_t frame) { | 405 void OfflineAudioContext::ResolveSuspendOnMainThread(size_t frame) { |
410 DCHECK(IsMainThread()); | 406 DCHECK(IsMainThread()); |
411 | 407 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 449 |
454 // Note that the GraphLock is required before this check. Since this needs | 450 // Note that the GraphLock is required before this check. Since this needs |
455 // to run on the audio thread, OfflineGraphAutoLocker must be used. | 451 // to run on the audio thread, OfflineGraphAutoLocker must be used. |
456 if (scheduled_suspends_.Contains(CurrentSampleFrame())) | 452 if (scheduled_suspends_.Contains(CurrentSampleFrame())) |
457 return true; | 453 return true; |
458 | 454 |
459 return false; | 455 return false; |
460 } | 456 } |
461 | 457 |
462 } // namespace blink | 458 } // namespace blink |
OLD | NEW |