Title: [228056] branches/safari-605-branch/Source/WebCore
Revision
228056
Author
jmarc...@apple.com
Date
2018-02-04 18:18:42 -0800 (Sun, 04 Feb 2018)

Log Message

Cherry-pick r227934. rdar://problem/37145534

Modified Paths

Diff

Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (228055 => 228056)


--- branches/safari-605-branch/Source/WebCore/ChangeLog	2018-02-05 02:18:40 UTC (rev 228055)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog	2018-02-05 02:18:42 UTC (rev 228056)
@@ -1,5 +1,26 @@
 2018-02-04  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r227934. rdar://problem/37145534
+
+    2018-01-31  Ryosuke Niwa  <rn...@webkit.org>
+
+            Add a release assertion to ensure timers are deleted in the right thread
+            https://bugs.webkit.org/show_bug.cgi?id=182351
+
+            Reviewed by David Kilzer.
+
+            Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.
+
+            We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
+            when WebThread is being used.
+
+            * platform/Timer.cpp:
+            (WebCore::TimerBase::~TimerBase): Added the assertion.
+            * platform/Timer.h:
+            (WebCore::TimerBase::m_thread): Always store the current thread in a timer.
+
+2018-02-04  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r227932. rdar://problem/37145456
 
     2018-01-31  Youenn Fablet  <you...@apple.com>

Modified: branches/safari-605-branch/Source/WebCore/platform/Timer.cpp (228055 => 228056)


--- branches/safari-605-branch/Source/WebCore/platform/Timer.cpp	2018-02-05 02:18:40 UTC (rev 228055)
+++ branches/safari-605-branch/Source/WebCore/platform/Timer.cpp	2018-02-05 02:18:42 UTC (rev 228056)
@@ -191,6 +191,7 @@
 
 TimerBase::~TimerBase()
 {
+    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(canAccessThreadLocalDataForThread(m_thread.get()));
     stop();
     ASSERT(!inHeap());
     m_wasDeleted = true;

Modified: branches/safari-605-branch/Source/WebCore/platform/Timer.h (228055 => 228056)


--- branches/safari-605-branch/Source/WebCore/platform/Timer.h	2018-02-05 02:18:40 UTC (rev 228055)
+++ branches/safari-605-branch/Source/WebCore/platform/Timer.h	2018-02-05 02:18:42 UTC (rev 228056)
@@ -103,9 +103,7 @@
     bool m_wasDeleted { false };
     Vector<TimerBase*>* m_cachedThreadGlobalTimerHeap { nullptr };
 
-#ifndef NDEBUG
     Ref<Thread> m_thread { Thread::current() };
-#endif
 
     friend class ThreadTimers;
     friend class TimerHeapLessThanFunction;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to