Chromium Code Reviews
DescriptionFix use-after-free in base::Timer::StopAndAbandon()
A timer may be owned by a ref counted class. If |Timer::user_task_| is a method
in the ref counted class, it is possible for |Timer::user_task_| to hold the
only reference to the ref counted class. This CL changes
Timer::StopAndAbandon() so that Timer::Stop() is called after
Timer::AbandonScheduledTask(). If |Timer::user_task_| holds the only reference
to ref counted class, Timer::Stop() destroys the timer object.
Timer::StopAndAbandon() can be called while |Timer::user_task_| holds the only
reference to the ref counted class if the message loop is shut down.
BUG=678592
TEST=MessageLoopShutdownSelfOwningTimer
Review-Url: https://codereview.chromium.org/2624133004
Cr-Commit-Position: refs/heads/master@{#444132}
Committed: https://chromium.googlesource.com/chromium/src/+/4a286ed6b9406edfb1031ae1d48766f79652a6ca
Patch Set 1 : Merge branch 'master' into timer_bug #
Total comments: 7
Patch Set 2 : Merge branch 'master' into timer_bug #
Messages
Total messages: 18 (10 generated)
|
||||||||||||||||||||||||||||