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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 1269483004: Remove redundant null check for AudioBus (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | 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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple 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 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 m_client = new HTMLMediaElement::AudioClientImpl(client); 3748 m_client = new HTMLMediaElement::AudioClientImpl(client);
3749 else 3749 else
3750 m_client.clear(); 3750 m_client.clear();
3751 3751
3752 if (m_webAudioSourceProvider) 3752 if (m_webAudioSourceProvider)
3753 m_webAudioSourceProvider->setClient(m_client.get()); 3753 m_webAudioSourceProvider->setClient(m_client.get());
3754 } 3754 }
3755 3755
3756 void HTMLMediaElement::AudioSourceProviderImpl::provideInput(AudioBus* bus, size _t framesToProcess) 3756 void HTMLMediaElement::AudioSourceProviderImpl::provideInput(AudioBus* bus, size _t framesToProcess)
3757 { 3757 {
3758 // TODO(srirama.m): Investigate whether the bus can be null or not
3759 // and remove either ASSERT or null check appropriately.
3760 ASSERT(bus); 3758 ASSERT(bus);
3761 if (!bus)
3762 return;
3763 3759
3764 MutexTryLocker tryLocker(provideInputLock); 3760 MutexTryLocker tryLocker(provideInputLock);
3765 if (!tryLocker.locked() || !m_webAudioSourceProvider || !m_client.get()) { 3761 if (!tryLocker.locked() || !m_webAudioSourceProvider || !m_client.get()) {
3766 bus->zero(); 3762 bus->zero();
3767 return; 3763 return;
3768 } 3764 }
3769 3765
3770 // Wrap the AudioBus channel data using WebVector. 3766 // Wrap the AudioBus channel data using WebVector.
3771 size_t n = bus->numberOfChannels(); 3767 size_t n = bus->numberOfChannels();
3772 WebVector<float*> webAudioData(n); 3768 WebVector<float*> webAudioData(n);
(...skipping 14 matching lines...) Expand all
3787 visitor->trace(m_client); 3783 visitor->trace(m_client);
3788 } 3784 }
3789 3785
3790 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) 3786 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl)
3791 { 3787 {
3792 visitor->trace(m_client); 3788 visitor->trace(m_client);
3793 } 3789 }
3794 #endif 3790 #endif
3795 3791
3796 } 3792 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698