OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } else { | 520 } else { |
521 // We were unable to get the lock, so put this in a list to finish up la
ter. | 521 // We were unable to get the lock, so put this in a list to finish up la
ter. |
522 ASSERT(context()->isAudioThread()); | 522 ASSERT(context()->isAudioThread()); |
523 ASSERT(refType == RefTypeConnection); | 523 ASSERT(refType == RefTypeConnection); |
524 context()->addDeferredFinishDeref(this); | 524 context()->addDeferredFinishDeref(this); |
525 } | 525 } |
526 | 526 |
527 // Once AudioContext::uninitialize() is called there's no more chances for d
eleteMarkedNodes() to get called, so we call here. | 527 // Once AudioContext::uninitialize() is called there's no more chances for d
eleteMarkedNodes() to get called, so we call here. |
528 // We can't call in AudioContext::~AudioContext() since it will never be cal
led as long as any AudioNode is alive | 528 // We can't call in AudioContext::~AudioContext() since it will never be cal
led as long as any AudioNode is alive |
529 // because AudioNodes keep a reference to the context. | 529 // because AudioNodes keep a reference to the context. |
530 if (context()->isAudioThreadFinished()) | 530 if (!context()->isInitialized()) |
531 context()->deleteMarkedNodes(); | 531 context()->deleteMarkedNodes(); |
532 } | 532 } |
533 | 533 |
534 void AudioNode::finishDeref(RefType refType) | 534 void AudioNode::finishDeref(RefType refType) |
535 { | 535 { |
536 ASSERT(context()->isGraphOwner()); | 536 ASSERT(context()->isGraphOwner()); |
537 | 537 |
538 switch (refType) { | 538 switch (refType) { |
539 case RefTypeNormal: | 539 case RefTypeNormal: |
540 ASSERT(m_normalRefCount > 0); | 540 ASSERT(m_normalRefCount > 0); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 // it cannot be reattached. Therefore, the reference count | 603 // it cannot be reattached. Therefore, the reference count |
604 // will not go above zero again. | 604 // will not go above zero again. |
605 ASSERT(m_keepAlive); | 605 ASSERT(m_keepAlive); |
606 m_keepAlive = nullptr; | 606 m_keepAlive = nullptr; |
607 } | 607 } |
608 #endif | 608 #endif |
609 | 609 |
610 } // namespace WebCore | 610 } // namespace WebCore |
611 | 611 |
612 #endif // ENABLE(WEB_AUDIO) | 612 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |