Changeset 112304 in webkit
- Timestamp:
- Mar 27, 2012 1:06:14 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112302 r112304 1 2012-03-27 Joe Mason <jmason@rim.com> 2 3 [BlackBerry] fix confusing destruction sequence in LayerCompositingThread 4 https://bugs.webkit.org/show_bug.cgi?id=81706 5 6 Reviewed by Rob Buis. 7 8 LayerCompositingThread has a destructor that does a synchronous 9 dispatch to the compositing thread and then does the actual cleanup 10 from a helper function. This is confusing.It should be the 11 opposite: the helper function dispatches to the compositing thread, 12 which calls delete. 13 14 No new tests since the existing animation tests will exercise this 15 code. 16 17 * platform/graphics/blackberry/LayerCompositingThread.cpp: 18 (WebCore::LayerCompositingThread::destroyOnCompositingThread): 19 (WebCore): 20 (WebCore::LayerCompositingThread::~LayerCompositingThread): 21 * platform/graphics/blackberry/LayerCompositingThread.h: 22 (LayerCompositingThread): 23 (WTF): 24 (WTF::::deref): 25 1 26 2012-03-27 Alexey Proskuryakov <ap@apple.com> 2 27 -
trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.cpp
r112110 r112304 72 72 } 73 73 74 LayerCompositingThread::~LayerCompositingThread()75 {76 // Unfortunately, ThreadSafeShared<T> is hardwired to call T::~T().77 // To switch threads in case the last reference is released on the78 // WebKit thread, we send a sync message to the compositing thread.79 destroyOnCompositingThread();80 }81 82 74 void LayerCompositingThread::destroyOnCompositingThread() 83 75 { … … 88 80 return; 89 81 } 82 83 delete this; 84 } 85 86 LayerCompositingThread::~LayerCompositingThread() 87 { 88 ASSERT(isCompositingThread()); 90 89 91 90 m_tiler->layerCompositingThreadDestroyed(); -
trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h
r112110 r112304 54 54 namespace WebCore { 55 55 56 class DestroyOnCompositingThread;57 56 class LayerRenderer; 58 57 … … 146 145 LayerCompositingThread(LayerType, PassRefPtr<LayerTiler>); 147 146 148 friend class DestroyOnCompositingThread;147 friend class WTF::ThreadSafeRefCounted<WebCore::LayerCompositingThread>; 149 148 void destroyOnCompositingThread(); 150 149 … … 189 188 }; 190 189 191 } 190 } // namespace WebCore 191 192 namespace WTF { 193 194 // LayerCompositingThread objects must be destroyed on the compositing thread. 195 // But it's possible for the last reference to be held by the WebKit thread. 196 // So we create a custom specialization of ThreadSafeRefCounted which calls a 197 // function that ensures the destructor is called on the correct thread, rather 198 // than calling delete directly. 199 template<> 200 inline void ThreadSafeRefCounted<WebCore::LayerCompositingThread>::deref() 201 { 202 if (derefBase()) 203 static_cast<WebCore::LayerCompositingThread*>(this)->destroyOnCompositingThread(); 204 } 205 206 } // namespace WTF 207 192 208 193 209 #endif // USE(ACCELERATED_COMPOSITING)
Note: See TracChangeset
for help on using the changeset viewer.