Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: Source/modules/webaudio/AudioNode.cpp

Issue 304103002: Remove unnecessary members for tricky lazy initialization in AudioContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698