Changeset 228056 in webkit


Ignore:
Timestamp:
Feb 4, 2018 6:18:42 PM (6 years ago)
Author:
jmarcell@apple.com
Message:

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

Location:
branches/safari-605-branch/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/Source/WebCore/ChangeLog

    r228055 r228056  
     12018-02-04  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r227934. rdar://problem/37145534
     4
     5    2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
     6
     7            Add a release assertion to ensure timers are deleted in the right thread
     8            https://bugs.webkit.org/show_bug.cgi?id=182351
     9
     10            Reviewed by David Kilzer.
     11
     12            Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.
     13
     14            We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
     15            when WebThread is being used.
     16
     17            * platform/Timer.cpp:
     18            (WebCore::TimerBase::~TimerBase): Added the assertion.
     19            * platform/Timer.h:
     20            (WebCore::TimerBase::m_thread): Always store the current thread in a timer.
     21
    1222018-02-04  Jason Marcell  <jmarcell@apple.com>
    223
  • branches/safari-605-branch/Source/WebCore/platform/Timer.cpp

    r225985 r228056  
    192192TimerBase::~TimerBase()
    193193{
     194    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(canAccessThreadLocalDataForThread(m_thread.get()));
    194195    stop();
    195196    ASSERT(!inHeap());
  • branches/safari-605-branch/Source/WebCore/platform/Timer.h

    r225985 r228056  
    104104    Vector<TimerBase*>* m_cachedThreadGlobalTimerHeap { nullptr };
    105105
    106 #ifndef NDEBUG
    107106    Ref<Thread> m_thread { Thread::current() };
    108 #endif
    109107
    110108    friend class ThreadTimers;
Note: See TracChangeset for help on using the changeset viewer.