Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 09cf0cb360d81842e3aea21528537db8dd891c7b
      
https://github.com/WebKit/WebKit/commit/09cf0cb360d81842e3aea21528537db8dd891c7b
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-03 (Thu, 03 Sep 2026)

  Changed paths:
    M Source/WebCore/Modules/mediasession/MediaSession.cpp

  Log Message:
  -----------
  MediaSession::setActionHandler() looks up the document multiple times and 
shadows a local
https://bugs.webkit.org/show_bug.cgi?id=323294
rdar://186544360

Reviewed by Jer Noble.

setActionHandler() called document() once inside the ENABLE(MEDIA_STREAM)
guard and again in an if-init statement that shadowed the first local, with
each document() call dereferencing m_navigator->window() twice. Hoist a
single RefPtr document to the top of the function (outside the MEDIA_STREAM
guard, so it is used in every build) and reuse it.

No change in behavior.

* Source/WebCore/Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::setActionHandler):

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



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

Reply via email to