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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 void AudioContext::clear() | 217 void AudioContext::clear() |
218 { | 218 { |
219 // We have to release our reference to the destination node before the conte
xt will ever be deleted since the destination node holds a reference to the cont
ext. | 219 // We have to release our reference to the destination node before the conte
xt will ever be deleted since the destination node holds a reference to the cont
ext. |
220 if (m_destinationNode) | 220 if (m_destinationNode) |
221 m_destinationNode.clear(); | 221 m_destinationNode.clear(); |
222 | 222 |
223 // Audio thread is dead. Nobody will schedule node deletion action. Let's do
it ourselves. | 223 // Audio thread is dead. Nobody will schedule node deletion action. Let's do
it ourselves. |
224 do { | 224 do { |
225 deleteMarkedNodes(); | 225 deleteMarkedNodes(); |
226 m_nodesToDelete.append(m_nodesMarkedForDeletion); | 226 m_nodesToDelete.appendVector(m_nodesMarkedForDeletion); |
227 m_nodesMarkedForDeletion.clear(); | 227 m_nodesMarkedForDeletion.clear(); |
228 } while (m_nodesToDelete.size()); | 228 } while (m_nodesToDelete.size()); |
229 | 229 |
230 // It was set in constructCommon. | 230 // It was set in constructCommon. |
231 unsetPendingActivity(this); | 231 unsetPendingActivity(this); |
232 } | 232 } |
233 | 233 |
234 void AudioContext::uninitialize() | 234 void AudioContext::uninitialize() |
235 { | 235 { |
236 ASSERT(isMainThread()); | 236 ASSERT(isMainThread()); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 | 872 |
873 void AudioContext::scheduleNodeDeletion() | 873 void AudioContext::scheduleNodeDeletion() |
874 { | 874 { |
875 bool isGood = m_isInitialized && isGraphOwner(); | 875 bool isGood = m_isInitialized && isGraphOwner(); |
876 ASSERT(isGood); | 876 ASSERT(isGood); |
877 if (!isGood) | 877 if (!isGood) |
878 return; | 878 return; |
879 | 879 |
880 // Make sure to call deleteMarkedNodes() on main thread. | 880 // Make sure to call deleteMarkedNodes() on main thread. |
881 if (m_nodesMarkedForDeletion.size() && !m_isDeletionScheduled) { | 881 if (m_nodesMarkedForDeletion.size() && !m_isDeletionScheduled) { |
882 m_nodesToDelete.append(m_nodesMarkedForDeletion); | 882 m_nodesToDelete.appendVector(m_nodesMarkedForDeletion); |
883 m_nodesMarkedForDeletion.clear(); | 883 m_nodesMarkedForDeletion.clear(); |
884 | 884 |
885 m_isDeletionScheduled = true; | 885 m_isDeletionScheduled = true; |
886 | 886 |
887 // Don't let ourself get deleted before the callback. | 887 // Don't let ourself get deleted before the callback. |
888 // See matching deref() in deleteMarkedNodesDispatch(). | 888 // See matching deref() in deleteMarkedNodesDispatch(). |
889 ref(); | 889 ref(); |
890 callOnMainThread(deleteMarkedNodesDispatch, this); | 890 callOnMainThread(deleteMarkedNodesDispatch, this); |
891 } | 891 } |
892 } | 892 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 } | 1057 } |
1058 | 1058 |
1059 void AudioContext::decrementActiveSourceCount() | 1059 void AudioContext::decrementActiveSourceCount() |
1060 { | 1060 { |
1061 atomicDecrement(&m_activeSourceCount); | 1061 atomicDecrement(&m_activeSourceCount); |
1062 } | 1062 } |
1063 | 1063 |
1064 } // namespace WebCore | 1064 } // namespace WebCore |
1065 | 1065 |
1066 #endif // ENABLE(WEB_AUDIO) | 1066 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |