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

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

Issue 416333002: Introduce AudioSourceProviderClientLockScope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use AudioSourceProviderClientLockScope even if !ENABLE(WEB_AUDIO) Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 outputBus->zero(); 140 outputBus->zero();
141 } 141 }
142 } else { 142 } else {
143 // We failed to acquire the lock. 143 // We failed to acquire the lock.
144 outputBus->zero(); 144 outputBus->zero();
145 } 145 }
146 } 146 }
147 147
148 void MediaElementAudioSourceNode::lock() 148 void MediaElementAudioSourceNode::lock()
149 { 149 {
150 m_keepAliveWhileLocking = this; 150 #if !ENABLE(OILPAN)
151 ref();
152 #endif
151 m_processLock.lock(); 153 m_processLock.lock();
152 } 154 }
153 155
154 void MediaElementAudioSourceNode::unlock() 156 void MediaElementAudioSourceNode::unlock()
155 { 157 {
156 m_processLock.unlock(); 158 m_processLock.unlock();
157 m_keepAliveWhileLocking.clear(); 159 #if !ENABLE(OILPAN)
160 deref();
161 #endif
158 } 162 }
159 163
160 void MediaElementAudioSourceNode::trace(Visitor* visitor) 164 void MediaElementAudioSourceNode::trace(Visitor* visitor)
161 { 165 {
162 visitor->trace(m_mediaElement); 166 visitor->trace(m_mediaElement);
163 AudioSourceNode::trace(visitor); 167 AudioSourceNode::trace(visitor);
164 AudioSourceProviderClient::trace(visitor); 168 AudioSourceProviderClient::trace(visitor);
165 } 169 }
166 170
167 } // namespace blink 171 } // namespace blink
168 172
169 #endif // ENABLE(WEB_AUDIO) 173 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698