[webkit-changes] [WebKit/WebKit] c234d2: REGRESSION(264515 at main): m_player WeakPtr is acces...

Jean-Yves Avenard noreply at github.com
Fri Jun 16 01:09:06 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c234d2219797395a7e23f45a681da9878c44f99a
      https://github.com/WebKit/WebKit/commit/c234d2219797395a7e23f45a681da9878c44f99a
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    M Source/WTF/wtf/WeakPtr.h

  Log Message:
  -----------
  REGRESSION(264515 at main): m_player WeakPtr is accessed from non-main threads
https://bugs.webkit.org/show_bug.cgi?id=258022
rdar://110817538

Reviewed by Youenn Fablet.

Tighten WeakPtr assertion that it can only be accessed on the GC thread
if it was created on the main thread.
We apply the same requirement to operator-> and operator* for consistency.

When the GC thread is running, the main thread is suspended which makes
it safe to use with main thread objects.

* Source/WTF/wtf/WeakPtr.h:
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const):
(WTF::WeakPtr::canSafelyBeUsed const):

Canonical link: https://commits.webkit.org/265233@main




More information about the webkit-changes mailing list