Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: becdb864c9ddd9e05c4ecfd9c2b304e0856dc015
      
https://github.com/WebKit/WebKit/commit/becdb864c9ddd9e05c4ecfd9c2b304e0856dc015
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-08-19 (Wed, 19 Aug 2026)

  Changed paths:
    M Source/WebCore/page/Location.cpp

  Log Message:
  -----------
  Location::ancestorOrigins() should build its cached list through a local Ref
https://bugs.webkit.org/show_bug.cgi?id=321827
rdar://184966612

Reviewed by Chris Dumez.

Location::ancestorOrigins() built its cached list by calling
protect(m_ancestorOrigins)->append(...) inside the ancestor walk, taking a
fresh RefPtr copy of the member on every iteration just to reach
DOMStringList::append(). Append through a Ref local instead.

This is a readability cleanup rather than a measurable win: the list is built
once per Location and then cached, ancestor chains are short, and
DOMStringList is non-atomically ref-counted, so the churn removed is a few
increments on a cold path. The copyRef() that publishes the member even adds
one ref/deref back in the common no-ancestor case.

The member is still assigned before the loop is entered, so the list is
published in the same order as before and a re-entrant read during the walk
observes the same partially-built list it does today.

No behavior change, so no new test.

* Source/WebCore/page/Location.cpp:
(WebCore::Location::ancestorOrigins const):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to