[webkit-changes] [WebKit/WebKit] 5eb1d5: HTMLVideoElement.requestVideoFrameCallback can lea...

Ryan Reno noreply at github.com
Mon Jul 8 14:43:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5eb1d50bc03d3ec080f64562e5d5af4d1ef51b2a
      https://github.com/WebKit/WebKit/commit/5eb1d50bc03d3ec080f64562e5d5af4d1ef51b2a
  Author: Ryan Reno <rreno at apple.com>
  Date:   2024-07-08 (Mon, 08 Jul 2024)

  Changed paths:
    A LayoutTests/fast/html/request-video-frame-callback-does-not-leak-expected.txt
    A LayoutTests/fast/html/request-video-frame-callback-does-not-leak.html
    A LayoutTests/fast/html/resources/request-video-frame-callback.html
    A LayoutTests/resources/document-leak-test.js
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/html/HTMLVideoElement.cpp
    M Source/WebCore/html/HTMLVideoElement.h

  Log Message:
  -----------
  HTMLVideoElement.requestVideoFrameCallback can leak its captures if cancelVideoFrameCallback is not called.
rdar://131184636
https://bugs.webkit.org/show_bug.cgi?id=276267

Reviewed by Youenn Fablet.

If HTMLVideoElement.requestVideoFrameCallback captures the document
object it will likely leak if cancelVideoFrameCallback is not called by
the web author. This change will clear pending and serviced video frame
callback lists in the HTMLVideoElement when ActiveDOMObject::stop is
called.

Additionally, I've factored out some common code which I've been using
in writing the Layout Tests for leak regression testing into a helper
file in LayoutTests/resources.

* LayoutTests/fast/html/request-video-frame-callback-does-not-leak-expected.txt: Added.
* LayoutTests/fast/html/request-video-frame-callback-does-not-leak.html: Added.
* LayoutTests/fast/html/resources/request-video-frame-callback.html: Added.
* LayoutTests/resources/document-leak-test.js: Added.
(createFrames):
(iframeForMessage):
(iframeLeaked):
(iframeSentMessage):
(runDocumentLeakTest):
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::stop):
* Source/WebCore/html/HTMLVideoElement.h:

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



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


More information about the webkit-changes mailing list