Always post destruction of WebMediaPlayer instances [chromium/src : main]

0 views
Skip to first unread message

Dale Curtis (Gerrit)

unread,
Feb 26, 2026, 5:35:49 PM (8 days ago) Feb 26
to Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
Attention needed from Daniel Cheng and Frank Liberato

Dale Curtis voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Frank Liberato
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
Gerrit-Change-Number: 7609443
Gerrit-PatchSet: 4
Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Thu, 26 Feb 2026 22:35:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Frank Liberato (Gerrit)

unread,
Feb 26, 2026, 5:51:15 PM (8 days ago) Feb 26
to Dale Curtis, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
Attention needed from Dale Curtis, Daniel Cheng and Frank Liberato

Frank Liberato added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Frank Liberato . resolved

for some reason i do not have permission to vote, but lgtm.

-fl

Open in Gerrit

Related details

Attention is currently required from:
  • Dale Curtis
  • Daniel Cheng
  • Frank Liberato
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
Gerrit-Change-Number: 7609443
Gerrit-PatchSet: 4
Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-CC: Frank Liberato <libe...@google.com>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Thu, 26 Feb 2026 22:51:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Frank Liberato (Gerrit)

unread,
Feb 26, 2026, 5:52:23 PM (8 days ago) Feb 26
to Dale Curtis, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
Attention needed from Dale Curtis, Daniel Cheng and Frank Liberato

Frank Liberato added 1 comment

Patchset-level comments
Frank Liberato . resolved

oh i see - it switched to google me and won't let me switch back for some reason. this worked this morning.

-fl

Gerrit-Comment-Date: Thu, 26 Feb 2026 22:52:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dale Curtis (Gerrit)

unread,
Feb 26, 2026, 7:50:05 PM (8 days ago) Feb 26
to Frank Liberato, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
Attention needed from Daniel Cheng and Frank Liberato

Dale Curtis voted Auto-Submit+1

Auto-Submit+1
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Frank Liberato
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
Gerrit-Change-Number: 7609443
Gerrit-PatchSet: 4
Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
Gerrit-CC: Frank Liberato <libe...@google.com>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Frank Liberato <libe...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Fri, 27 Feb 2026 00:50:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
Feb 27, 2026, 3:13:15 AM (8 days ago) Feb 27
to Dale Curtis, Frank Liberato, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
Attention needed from Dale Curtis and Frank Liberato

Daniel Cheng added 8 comments

Patchset-level comments
Daniel Cheng . unresolved

I don't love this; there are a lot of other GCed types that are exposed through the Blink public API. I'm not going to say it's painless, but it's not usually that unwieldy either. But I didn't investigate so I don't quite know all the roadblocks that might be involved here...

File third_party/blink/public/platform/web_media_player.h
Line 189, Patchset 4 (Latest): virtual ~WebMediaPlayer() = default;
Daniel Cheng . unresolved

Probably want to make this protected.

File third_party/blink/renderer/core/html/media/html_media_element.cc
Line 4184, Patchset 4 (Latest): web_media_player_->Shutdown();
Daniel Cheng . unresolved

So code like this can't accidentally use `reset()`. It would mean we would need to pass the task runner to Shutdown() but maybe Shutdown() could post the `delete this` task itself then.

File third_party/blink/renderer/modules/mediastream/web_media_player_ms.cc
Line 400, Patchset 4 (Latest): if (delegate_) {
Daniel Cheng . unresolved

Can we fix the tests?

Line 458, Patchset 4 (Latest): weak_factory_.InvalidateWeakPtrs();
Daniel Cheng . unresolved
```suggestion
weak_factory_.InvalidateWeakPtrsAndDoom();
```
Otherwise people can just call `GetWeakPtr()` again.
File third_party/blink/renderer/platform/media/web_media_player_impl.cc
Line 611, Patchset 4 (Latest): // Allow automatic cleanup for tests.
Daniel Cheng . unresolved

Is it hard to fix tests to do the right thing? It would be better not to have this.

Line 699, Patchset 4 (Latest): weak_factory_.InvalidateWeakPtrs();
Daniel Cheng . unresolved
```suggestion
weak_factory_.InvalidateWeakPtrsAndDoom();
```
File third_party/blink/renderer/platform/testing/empty_web_media_player.h
Line 31, Patchset 4 (Latest): void Shutdown() override { weak_ptr_factory_.InvalidateWeakPtrs(); }
Daniel Cheng . unresolved
```suggestion
void Shutdown() override { weak_ptr_factory_.InvalidateWeakPtrsAndDoom(); }
```
Open in Gerrit

Related details

Attention is currently required from:
  • Dale Curtis
  • Frank Liberato
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
    Gerrit-Change-Number: 7609443
    Gerrit-PatchSet: 4
    Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
    Gerrit-CC: Frank Liberato <libe...@google.com>
    Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
    Gerrit-Attention: Frank Liberato <libe...@chromium.org>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Comment-Date: Fri, 27 Feb 2026 08:13:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Frank Liberato (Gerrit)

    unread,
    Feb 27, 2026, 11:53:27 AM (7 days ago) Feb 27
    to Dale Curtis, Frank Liberato, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
    Attention needed from Dale Curtis

    Frank Liberato voted and added 1 comment

    Votes added by Frank Liberato

    Code-Review+1

    1 comment

    File third_party/blink/renderer/platform/testing/empty_web_media_player.h
    Line 31, Patchset 4 (Latest): void Shutdown() override { weak_ptr_factory_.InvalidateWeakPtrs(); }
    Daniel Cheng . unresolved
    ```suggestion
    void Shutdown() override { weak_ptr_factory_.InvalidateWeakPtrsAndDoom(); }
    ```
    Frank Liberato

    '...AndDoom'? never heard of that one. it's a cool name, Frodo Baggins.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
      Gerrit-Change-Number: 7609443
      Gerrit-PatchSet: 4
      Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
      Gerrit-CC: Frank Liberato <libe...@google.com>
      Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Comment-Date: Fri, 27 Feb 2026 16:53:21 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Mar 2, 2026, 12:32:24 PM (4 days ago) Mar 2
      to Frank Liberato, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
      Attention needed from Daniel Cheng

      Dale Curtis added 2 comments

      Patchset-level comments
      Daniel Cheng . unresolved

      I don't love this; there are a lot of other GCed types that are exposed through the Blink public API. I'm not going to say it's painless, but it's not usually that unwieldy either. But I didn't investigate so I don't quite know all the roadblocks that might be involved here...

      Dale Curtis

      A quick search doesn't show any GarbageCollected interfaces in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/ ? Can you give an example?

      File third_party/blink/renderer/core/html/media/html_media_element.cc
      Line 4184, Patchset 4 (Latest): web_media_player_->Shutdown();
      Daniel Cheng . unresolved

      So code like this can't accidentally use `reset()`. It would mean we would need to pass the task runner to Shutdown() but maybe Shutdown() could post the `delete this` task itself then.

      Dale Curtis

      If we don't take your suggestion below, we don't need the complexity you suggest here. Either way is fine, it's just that the singular HTMLME destruction path needs to post. Outside of tests, HTMLME is the only owner of this class.

      Can you elaborate on why you think not automatically calling Shutdown() in destruction is better? I can see the appeal with a utility interface with diverse usage, but that's not the case here.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
      Gerrit-Change-Number: 7609443
      Gerrit-PatchSet: 4
      Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
      Gerrit-CC: Frank Liberato <libe...@google.com>
      Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Mon, 02 Mar 2026 17:32:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Mar 4, 2026, 3:28:00 AM (3 days ago) Mar 4
      to Dale Curtis, Frank Liberato, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
      Attention needed from Dale Curtis

      Daniel Cheng added 2 comments

      Patchset-level comments
      Daniel Cheng . unresolved

      I don't love this; there are a lot of other GCed types that are exposed through the Blink public API. I'm not going to say it's painless, but it's not usually that unwieldy either. But I didn't investigate so I don't quite know all the roadblocks that might be involved here...

      Dale Curtis

      A quick search doesn't show any GarbageCollected interfaces in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/ ? Can you give an example?

      Daniel Cheng

      `WebFrame`/`WebLocalFrame` is one example. It's not marked as GCed in the public API [1], since we've decided not to expose Oilpan details outside Blink. But the actual implementation class `WebLocalFrameImpl` is garbage collected [2]; it inherits from `GarbageCollected<T>` and `WebNavigationControl` (the latter of which inherits from `WebLocalFrame`).

      Blink's embedder (//content) owns the lifetime of web frames. When the lifetime of the `WebFrame` should end, the embedder calls `WebFrame::Close` [3]. Internally, this releases `WebLocalFrameImpl`'s `SelfKeepAlive` reference–from the perspective of //content, it may no longer use a `WebFrame` once it calls `Close()` on it. This is (part of) the reason `RenderFrameImpl` has `weak_this` checks [4] in various places... (the other reason is missing the `weak_this` check would simply be a use-after-free of the `RenderFrameImpl` :)

      It'd be a bit trickier for `WebMediaPlayer`... unlike `WebLocalFrame`, we don't really need the `SelfKeepAlive` since the embedder / //media doesn't hang on to the `WebMediaPlayer` after creating it. The web frame bits have changed significantly over time, but way we originally "solved" it there was by having `WebFrameImplBase` [5]. For `WebMediaPlayer`... I'm actually wondering how much of `WMP` really needs to be exposed in the Blink public API. It seems like media really just needs the factory APIs to create WMP instances, and that we could probably hide all the actual subclass details in Blink... so we could even (potentially) get away with just returning an opaque `WebMediaPlayer` pointer through the public API...

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/web/web_local_frame.h;l=132;drc=84e9f8cb8ba9621be941c81af04d33df743f7de4
      [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/web_local_frame_impl.h;l=114;drc=2b6f052e3ec785493a37c4573c972954566dbda7
      [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/web/web_frame.h;l=104;drc=aece0d42b548b986c6e54b8ef92acaa96591dac9
      [4] https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/render_frame_impl.cc;l=3346;drc=b50ce753d86531e4c8c57c2e836e50ba6340a184
      [5] https://codereview.chromium.org/2837593002 is the CL that removed `WebFrameImplBase` to get an idea of what it used to look like.

      File third_party/blink/renderer/core/html/media/html_media_element.cc
      Line 4184, Patchset 4 (Latest): web_media_player_->Shutdown();
      Daniel Cheng . unresolved

      So code like this can't accidentally use `reset()`. It would mean we would need to pass the task runner to Shutdown() but maybe Shutdown() could post the `delete this` task itself then.

      Dale Curtis

      If we don't take your suggestion below, we don't need the complexity you suggest here. Either way is fine, it's just that the singular HTMLME destruction path needs to post. Outside of tests, HTMLME is the only owner of this class.

      Can you elaborate on why you think not automatically calling Shutdown() in destruction is better? I can see the appeal with a utility interface with diverse usage, but that's not the case here.

      Daniel Cheng

      Hmm... so it's just my feeling that if we're relying on things like "post deletion of `this` to avoid potential use-after-frees", we really ought to encapsulate that as much as possible. I agree that as-written it's safe, but it's also one of those things that seems easy to accidentally regress sometime in the future if code is refactored.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
      Gerrit-Change-Number: 7609443
      Gerrit-PatchSet: 4
      Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
      Gerrit-CC: Frank Liberato <libe...@google.com>
      Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Comment-Date: Wed, 04 Mar 2026 08:27:51 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Mar 4, 2026, 12:46:02 PM (2 days ago) Mar 4
      to Frank Liberato, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
      Attention needed from Daniel Cheng

      Dale Curtis added 2 comments

      Patchset-level comments
      Daniel Cheng . unresolved

      I don't love this; there are a lot of other GCed types that are exposed through the Blink public API. I'm not going to say it's painless, but it's not usually that unwieldy either. But I didn't investigate so I don't quite know all the roadblocks that might be involved here...

      Dale Curtis

      A quick search doesn't show any GarbageCollected interfaces in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/ ? Can you give an example?

      Daniel Cheng

      `WebFrame`/`WebLocalFrame` is one example. It's not marked as GCed in the public API [1], since we've decided not to expose Oilpan details outside Blink. But the actual implementation class `WebLocalFrameImpl` is garbage collected [2]; it inherits from `GarbageCollected<T>` and `WebNavigationControl` (the latter of which inherits from `WebLocalFrame`).

      Blink's embedder (//content) owns the lifetime of web frames. When the lifetime of the `WebFrame` should end, the embedder calls `WebFrame::Close` [3]. Internally, this releases `WebLocalFrameImpl`'s `SelfKeepAlive` reference–from the perspective of //content, it may no longer use a `WebFrame` once it calls `Close()` on it. This is (part of) the reason `RenderFrameImpl` has `weak_this` checks [4] in various places... (the other reason is missing the `weak_this` check would simply be a use-after-free of the `RenderFrameImpl` :)

      It'd be a bit trickier for `WebMediaPlayer`... unlike `WebLocalFrame`, we don't really need the `SelfKeepAlive` since the embedder / //media doesn't hang on to the `WebMediaPlayer` after creating it. The web frame bits have changed significantly over time, but way we originally "solved" it there was by having `WebFrameImplBase` [5]. For `WebMediaPlayer`... I'm actually wondering how much of `WMP` really needs to be exposed in the Blink public API. It seems like media really just needs the factory APIs to create WMP instances, and that we could probably hide all the actual subclass details in Blink... so we could even (potentially) get away with just returning an opaque `WebMediaPlayer` pointer through the public API...

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/web/web_local_frame.h;l=132;drc=84e9f8cb8ba9621be941c81af04d33df743f7de4
      [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/web_local_frame_impl.h;l=114;drc=2b6f052e3ec785493a37c4573c972954566dbda7
      [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/web/web_frame.h;l=104;drc=aece0d42b548b986c6e54b8ef92acaa96591dac9
      [4] https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/render_frame_impl.cc;l=3346;drc=b50ce753d86531e4c8c57c2e836e50ba6340a184
      [5] https://codereview.chromium.org/2837593002 is the CL that removed `WebFrameImplBase` to get an idea of what it used to look like.

      Dale Curtis

      Thanks, I'll look through this. Frank indicates he took a stab at this previously and it rapidly exploded though. There are quite a few things that WMP creation needs from content/, I think it could be reflowed such that move of `MediaFactory` lives in blink, but it's a big effort.

      I worry that even if we succeed in making WMP GC'd, we'll just have fragmented the problem into a number of other pieces lower in the stack. WMP has lots of non-GC'd members which call back into it via interfaces which would now suffer from the same problem we're having with WMP + GC'd objects.

      File third_party/blink/renderer/core/html/media/html_media_element.cc
      Line 4184, Patchset 4 (Latest): web_media_player_->Shutdown();
      Daniel Cheng . unresolved

      So code like this can't accidentally use `reset()`. It would mean we would need to pass the task runner to Shutdown() but maybe Shutdown() could post the `delete this` task itself then.

      Dale Curtis

      If we don't take your suggestion below, we don't need the complexity you suggest here. Either way is fine, it's just that the singular HTMLME destruction path needs to post. Outside of tests, HTMLME is the only owner of this class.

      Can you elaborate on why you think not automatically calling Shutdown() in destruction is better? I can see the appeal with a utility interface with diverse usage, but that's not the case here.

      Daniel Cheng

      Hmm... so it's just my feeling that if we're relying on things like "post deletion of `this` to avoid potential use-after-frees", we really ought to encapsulate that as much as possible. I agree that as-written it's safe, but it's also one of those things that seems easy to accidentally regress sometime in the future if code is refactored.

      Dale Curtis

      I'll see about adding a DCHECK for having shutdown called and see how much explodes with that.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
      Gerrit-Change-Number: 7609443
      Gerrit-PatchSet: 4
      Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
      Gerrit-CC: Frank Liberato <libe...@google.com>
      Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Wed, 04 Mar 2026 17:45:53 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Mar 4, 2026, 4:39:17 PM (2 days ago) Mar 4
      to Frank Liberato, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
      Attention needed from Daniel Cheng and Frank Liberato

      Dale Curtis voted and added 7 comments

      Votes added by Dale Curtis

      Auto-Submit+0
      Commit-Queue+1

      7 comments

      File third_party/blink/public/platform/web_media_player.h
      Line 189, Patchset 4: virtual ~WebMediaPlayer() = default;
      Daniel Cheng . resolved

      Probably want to make this protected.

      Dale Curtis

      Didn't do this one in favor of just having a CHECK().

      File third_party/blink/renderer/core/html/media/html_media_element.cc
      Line 4184, Patchset 4: web_media_player_->Shutdown();
      Daniel Cheng . resolved

      So code like this can't accidentally use `reset()`. It would mean we would need to pass the task runner to Shutdown() but maybe Shutdown() could post the `delete this` task itself then.

      Dale Curtis

      If we don't take your suggestion below, we don't need the complexity you suggest here. Either way is fine, it's just that the singular HTMLME destruction path needs to post. Outside of tests, HTMLME is the only owner of this class.

      Can you elaborate on why you think not automatically calling Shutdown() in destruction is better? I can see the appeal with a utility interface with diverse usage, but that's not the case here.

      Daniel Cheng

      Hmm... so it's just my feeling that if we're relying on things like "post deletion of `this` to avoid potential use-after-frees", we really ought to encapsulate that as much as possible. I agree that as-written it's safe, but it's also one of those things that seems easy to accidentally regress sometime in the future if code is refactored.

      Dale Curtis

      I'll see about adding a DCHECK for having shutdown called and see how much explodes with that.

      Dale Curtis

      Seems like this ended up pretty easy, but we'll see what CQ says.

      File third_party/blink/renderer/modules/mediastream/web_media_player_ms.cc
      Line 400, Patchset 4: if (delegate_) {
      Daniel Cheng . resolved

      Can we fix the tests?

      Dale Curtis

      Done

      Line 458, Patchset 4: weak_factory_.InvalidateWeakPtrs();
      Daniel Cheng . resolved
      ```suggestion
      weak_factory_.InvalidateWeakPtrsAndDoom();
      ```
      Otherwise people can just call `GetWeakPtr()` again.
      Dale Curtis

      Done

      File third_party/blink/renderer/platform/media/web_media_player_impl.cc
      Line 611, Patchset 4: // Allow automatic cleanup for tests.
      Daniel Cheng . resolved

      Is it hard to fix tests to do the right thing? It would be better not to have this.

      Dale Curtis

      Done

      Line 699, Patchset 4: weak_factory_.InvalidateWeakPtrs();
      Daniel Cheng . resolved
      ```suggestion
      weak_factory_.InvalidateWeakPtrsAndDoom();
      ```
      Dale Curtis

      Done

      File third_party/blink/renderer/platform/testing/empty_web_media_player.h
      Line 31, Patchset 4: void Shutdown() override { weak_ptr_factory_.InvalidateWeakPtrs(); }
      Daniel Cheng . resolved
      ```suggestion
      void Shutdown() override { weak_ptr_factory_.InvalidateWeakPtrsAndDoom(); }
      ```
      Frank Liberato

      '...AndDoom'? never heard of that one. it's a cool name, Frodo Baggins.

      Dale Curtis

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Frank Liberato
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
        Gerrit-Change-Number: 7609443
        Gerrit-PatchSet: 6
        Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
        Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
        Gerrit-CC: Frank Liberato <libe...@google.com>
        Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
        Gerrit-Attention: Frank Liberato <libe...@chromium.org>
        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
        Gerrit-Comment-Date: Wed, 04 Mar 2026 21:39:07 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Frank Liberato <libe...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Daniel Cheng (Gerrit)

        unread,
        Mar 4, 2026, 6:27:15 PM (2 days ago) Mar 4
        to Dale Curtis, Daniel Cheng, Frank Liberato, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
        Attention needed from Dale Curtis and Frank Liberato

        Daniel Cheng voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dale Curtis
        • Frank Liberato
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
        Gerrit-Change-Number: 7609443
        Gerrit-PatchSet: 7
        Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
        Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
        Gerrit-CC: Frank Liberato <libe...@google.com>
        Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
        Gerrit-Attention: Frank Liberato <libe...@chromium.org>
        Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
        Gerrit-Comment-Date: Wed, 04 Mar 2026 23:27:04 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Dale Curtis (Gerrit)

        unread,
        Mar 4, 2026, 7:17:18 PM (2 days ago) Mar 4
        to Daniel Cheng, Frank Liberato, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
        Attention needed from Frank Liberato

        Dale Curtis voted Auto-Submit+1

        Auto-Submit+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Frank Liberato
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
        Gerrit-Change-Number: 7609443
        Gerrit-PatchSet: 7
        Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
        Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
        Gerrit-CC: Frank Liberato <libe...@google.com>
        Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
        Gerrit-Attention: Frank Liberato <libe...@chromium.org>
        Gerrit-Comment-Date: Thu, 05 Mar 2026 00:17:08 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Dale Curtis (Gerrit)

        unread,
        Mar 4, 2026, 7:17:27 PM (2 days ago) Mar 4
        to Daniel Cheng, Frank Liberato, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
        Attention needed from Frank Liberato

        Dale Curtis added 1 comment

        Patchset-level comments
        File-level comment, Patchset 4:
        Daniel Cheng . resolved

        I don't love this; there are a lot of other GCed types that are exposed through the Blink public API. I'm not going to say it's painless, but it's not usually that unwieldy either. But I didn't investigate so I don't quite know all the roadblocks that might be involved here...

        Dale Curtis

        A quick search doesn't show any GarbageCollected interfaces in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/ ? Can you give an example?

        Daniel Cheng

        `WebFrame`/`WebLocalFrame` is one example. It's not marked as GCed in the public API [1], since we've decided not to expose Oilpan details outside Blink. But the actual implementation class `WebLocalFrameImpl` is garbage collected [2]; it inherits from `GarbageCollected<T>` and `WebNavigationControl` (the latter of which inherits from `WebLocalFrame`).

        Blink's embedder (//content) owns the lifetime of web frames. When the lifetime of the `WebFrame` should end, the embedder calls `WebFrame::Close` [3]. Internally, this releases `WebLocalFrameImpl`'s `SelfKeepAlive` reference–from the perspective of //content, it may no longer use a `WebFrame` once it calls `Close()` on it. This is (part of) the reason `RenderFrameImpl` has `weak_this` checks [4] in various places... (the other reason is missing the `weak_this` check would simply be a use-after-free of the `RenderFrameImpl` :)

        It'd be a bit trickier for `WebMediaPlayer`... unlike `WebLocalFrame`, we don't really need the `SelfKeepAlive` since the embedder / //media doesn't hang on to the `WebMediaPlayer` after creating it. The web frame bits have changed significantly over time, but way we originally "solved" it there was by having `WebFrameImplBase` [5]. For `WebMediaPlayer`... I'm actually wondering how much of `WMP` really needs to be exposed in the Blink public API. It seems like media really just needs the factory APIs to create WMP instances, and that we could probably hide all the actual subclass details in Blink... so we could even (potentially) get away with just returning an opaque `WebMediaPlayer` pointer through the public API...

        [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/web/web_local_frame.h;l=132;drc=84e9f8cb8ba9621be941c81af04d33df743f7de4
        [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/web_local_frame_impl.h;l=114;drc=2b6f052e3ec785493a37c4573c972954566dbda7
        [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/web/web_frame.h;l=104;drc=aece0d42b548b986c6e54b8ef92acaa96591dac9
        [4] https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/render_frame_impl.cc;l=3346;drc=b50ce753d86531e4c8c57c2e836e50ba6340a184
        [5] https://codereview.chromium.org/2837593002 is the CL that removed `WebFrameImplBase` to get an idea of what it used to look like.

        Dale Curtis

        Thanks, I'll look through this. Frank indicates he took a stab at this previously and it rapidly exploded though. There are quite a few things that WMP creation needs from content/, I think it could be reflowed such that move of `MediaFactory` lives in blink, but it's a big effort.

        I worry that even if we succeed in making WMP GC'd, we'll just have fragmented the problem into a number of other pieces lower in the stack. WMP has lots of non-GC'd members which call back into it via interfaces which would now suffer from the same problem we're having with WMP + GC'd objects.

        Dale Curtis

        Acknowledged

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Frank Liberato
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
          Gerrit-Change-Number: 7609443
          Gerrit-PatchSet: 7
          Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
          Gerrit-CC: Frank Liberato <libe...@google.com>
          Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
          Gerrit-Attention: Frank Liberato <libe...@chromium.org>
          Gerrit-Comment-Date: Thu, 05 Mar 2026 00:17:18 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          open
          diffy

          Frank Liberato (Gerrit)

          unread,
          Mar 5, 2026, 4:01:18 PM (yesterday) Mar 5
          to Dale Curtis, Daniel Cheng, Frank Liberato, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org
          Attention needed from Dale Curtis

          Frank Liberato voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dale Curtis
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
          Gerrit-Change-Number: 7609443
          Gerrit-PatchSet: 7
          Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
          Gerrit-CC: Frank Liberato <libe...@google.com>
          Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
          Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
          Gerrit-Comment-Date: Thu, 05 Mar 2026 21:01:07 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Dale Curtis (Gerrit)

          unread,
          Mar 5, 2026, 5:12:03 PM (yesterday) Mar 5
          to Daniel Cheng, Frank Liberato, Chromium LUCI CQ, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org

          Dale Curtis voted Commit-Queue+2

          Commit-Queue+2
          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
          Gerrit-Change-Number: 7609443
          Gerrit-PatchSet: 7
          Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
          Gerrit-CC: Frank Liberato <libe...@google.com>
          Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
          Gerrit-Comment-Date: Thu, 05 Mar 2026 22:11:53 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          Mar 5, 2026, 7:33:47 PM (yesterday) Mar 5
          to Dale Curtis, Daniel Cheng, Frank Liberato, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org, tommyw+w...@chromium.org

          Chromium LUCI CQ submitted the change

          Change information

          Commit message:
          Always post destruction of WebMediaPlayer instances

          There are lots of ways that re-entrant destruction of players can
          happen. Fixing them all piecemeal is fragile and making WMP garbage
          collected is difficult since it's a blink/public interface. For now
          just add a Shutdown mechanism and post destruction such that we
          never have re-entrant destruction.
          Bug: 482958590, 459524033
          Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
          Reviewed-by: Daniel Cheng <dch...@chromium.org>
          Reviewed-by: Frank Liberato <libe...@chromium.org>
          Auto-Submit: Dale Curtis <dalec...@chromium.org>
          Commit-Queue: Dale Curtis <dalec...@chromium.org>
          Cr-Commit-Position: refs/heads/main@{#1595039}
          Files:
          • M third_party/blink/public/platform/web_media_player.h
          • M third_party/blink/public/web/modules/mediastream/web_media_player_ms.h
          • M third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
          • M third_party/blink/renderer/core/html/media/html_media_element.cc
          • M third_party/blink/renderer/modules/mediacapturefromelement/html_video_element_capturer_source_unittest.cc
          • M third_party/blink/renderer/modules/mediastream/web_media_player_ms.cc
          • M third_party/blink/renderer/modules/mediastream/web_media_player_ms_test.cc
          • M third_party/blink/renderer/platform/media/web_media_player_impl.cc
          • M third_party/blink/renderer/platform/media/web_media_player_impl.h
          • M third_party/blink/renderer/platform/testing/empty_web_media_player.h
          Change size: M
          Delta: 10 files changed, 54 insertions(+), 28 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Frank Liberato, +1 by Daniel Cheng
          Open in Gerrit
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: merged
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I9ccdaeed448850a5133deb464dcaeafa7447fe94
          Gerrit-Change-Number: 7609443
          Gerrit-PatchSet: 8
          Gerrit-Owner: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages