Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e3627f43f3e6863a69c9a53bb3a562085358b93e
      
https://github.com/WebKit/WebKit/commit/e3627f43f3e6863a69c9a53bb3a562085358b93e
  Author: Alex Christensen <[email protected]>
  Date:   2025-05-19 (Mon, 19 May 2025)

  Changed paths:
    M Source/WebCore/page/Frame.cpp
    M Source/WebCore/page/Frame.h

  Log Message:
  -----------
  Make WebCore::Frame a main-thread-only object
https://bugs.webkit.org/show_bug.cgi?id=293141
rdar://104512003

Reviewed by Geoffrey Garen and David Kilzer.

ThreadSafeRefCounted and CanMakeWeakPtr is a recipe for thread safety issues.
The common solution is to remove CanMakeWeakPtr and add 
ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr
and replace WeakPtr<T> with ThreadSafeWeakPtr<T>.  With WebCore::Frame, however,
that would require a lot of changes and I think it would be heading in the wrong
direction.  Instead, we remove ThreadSafeRefCounted and make it RefCounted 
instead.
It was originally made ThreadSafeRefCounted in 160925@main and I don't think it 
needs to be.

This has several benefits:
1. If it's ever used off the main thread, we will see debug assertions that 
will help us fix
the issue.  It shouldn't ever be used off the main thread.
2. It makes ref/deref no longer need to be an atomic operation, which means 
it's a little faster.
3. The compiler can now elide ref/deref pairs it can prove aren't necessary, 
which means it's
even faster.  The only operation faster than 1 operation is 0 operations.

* Source/WebCore/page/Frame.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to