comparison modules/javafx.web/src/main/native/Source/WebCore/platform/Timer.cpp @ 11342:d7d63c79d24f

Merge
author kcr
date Tue, 10 Sep 2019 08:52:49 -0700
parents db2c977a840b
children
comparison
equal deleted inserted replaced
5:f57615a91c3a 6:f67a476fcf85
35 #include <limits> 35 #include <limits>
36 #include <math.h> 36 #include <math.h>
37 #include <wtf/MainThread.h> 37 #include <wtf/MainThread.h>
38 #include <wtf/Vector.h> 38 #include <wtf/Vector.h>
39 39
40 #if PLATFORM(IOS) || PLATFORM(MAC) 40 #if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
41 #include <wtf/spi/darwin/dyldSPI.h> 41 #include <wtf/spi/darwin/dyldSPI.h>
42 #endif 42 #endif
43 43
44 namespace WebCore { 44 namespace WebCore {
45 45
227 } 227 }
228 228
229 private: 229 private:
230 static bool compare(MonotonicTime aTime, unsigned aOrder, MonotonicTime bTime, unsigned bOrder) 230 static bool compare(MonotonicTime aTime, unsigned aOrder, MonotonicTime bTime, unsigned bOrder)
231 { 231 {
232 // The comparisons below are "backwards" because the heap puts the largest 232 // The comparisons below are "backwards" because the heap puts the largest
233 // element first and we want the lowest time to be the first one in the heap. 233 // element first and we want the lowest time to be the first one in the heap.
234 if (bTime != aTime) 234 if (bTime != aTime)
235 return bTime < aTime; 235 return bTime < aTime;
236 // We need to look at the difference of the insertion orders instead of comparing the two 236 // We need to look at the difference of the insertion orders instead of comparing the two
237 // outright in case of overflow. 237 // outright in case of overflow.
238 unsigned difference = aOrder - bOrder; 238 unsigned difference = aOrder - bOrder;
239 return difference < std::numeric_limits<unsigned>::max() / 2; 239 return difference < std::numeric_limits<unsigned>::max() / 2;
240 } 240 }
241 }; 241 };
242 242
243 // ---------------- 243 // ----------------
244 244
245 static bool shouldSuppressThreadSafetyCheck() 245 static bool shouldSuppressThreadSafetyCheck()
246 { 246 {
247 #if PLATFORM(IOS) 247 #if PLATFORM(IOS_FAMILY)
248 return WebThreadIsEnabled() || applicationSDKVersion() < DYLD_IOS_VERSION_12_0; 248 return WebThreadIsEnabled() || applicationSDKVersion() < DYLD_IOS_VERSION_12_0;
249 #elif PLATFORM(MAC) 249 #elif PLATFORM(MAC)
250 return !isInWebProcess() && applicationSDKVersion() < DYLD_MACOSX_VERSION_10_14; 250 return !isInWebProcess() && applicationSDKVersion() < DYLD_MACOSX_VERSION_10_14;
251 #else 251 #else
252 return false; 252 return false;
260 260
261 TimerBase::~TimerBase() 261 TimerBase::~TimerBase()
262 { 262 {
263 ASSERT(canAccessThreadLocalDataForThread(m_thread.get())); 263 ASSERT(canAccessThreadLocalDataForThread(m_thread.get()));
264 RELEASE_ASSERT(canAccessThreadLocalDataForThread(m_thread.get()) || shouldSuppressThreadSafetyCheck()); 264 RELEASE_ASSERT(canAccessThreadLocalDataForThread(m_thread.get()) || shouldSuppressThreadSafetyCheck());
265 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(canAccessThreadLocalDataForThread(m_thread.get()));
266 stop(); 265 stop();
267 ASSERT(!inHeap()); 266 ASSERT(!inHeap());
268 if (m_heapItem) { 267 if (m_heapItem) {
269 m_heapItem->clearTimer(); 268 m_heapItem->clearTimer();
270 m_heapItem = nullptr; 269 m_heapItem = nullptr;