Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal [chromium/src : main]

10 views
Skip to first unread message

Omer Katz (Gerrit)

unread,
Nov 22, 2023, 4:17:42 PM11/22/23
to Kentaro Hara, Michael Lippautz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org

Attention is currently required from: Kentaro Hara, Michael Lippautz.

Omer Katz would like Kentaro Hara and Michael Lippautz to review this change.

View Change

Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal

Bug: chromium:1246423
Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
---
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
M third_party/blink/renderer/platform/heap/weak_cell.h
3 files changed, 44 insertions(+), 21 deletions(-)


To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 1
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>

Omer Katz (Gerrit)

unread,
Nov 22, 2023, 4:17:46 PM11/22/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Kentaro Hara, Michael Lippautz.

View Change

1 comment:

  • Patchset:

    • Patch Set #1:

      ptal

      Using WeakPtrFactory with GCed types is generally unsafe and should be replaced with the GC-safe WeakCellFactory.

      +mlippautz for weak_cell.h
      This use case should ideally use CrossThreadHandle, but CrossThreadHandle is missing some traits to allow it to be used with `AsyncCall` and `Then`.
      I prefer to land this fix with CrossThreadPersistent for now to unblock plugin checks and replace it later with CrossThreadHandle.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 1
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Wed, 22 Nov 2023 21:17:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Kentaro Hara (Gerrit)

unread,
Nov 22, 2023, 10:14:54 PM11/22/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Michael Lippautz, Omer Katz.

Patch set 1:Code-Review +1

View Change

2 comments:

  • Patchset:

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.h:

    • Patch Set #1, Line 168: base::WeakPtrFactory<ImageDecoderExternal> decode_weak_factory_{this};

      Why was this working? Was it a bug?

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 1
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 03:14:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Dale Curtis (Gerrit)

unread,
Nov 22, 2023, 11:35:34 PM11/22/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Kentaro Hara, Michael Lippautz, Omer Katz.

View Change

5 comments:

  • Patchset:

    • Patch Set #1:

      Please update the comments before submitting. I haven't checked closely, but presumably WeakCell now enforces all the constraints this class was abiding by.

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.h:

    • Patch Set #1, Line 168: base::WeakPtrFactory<ImageDecoderExternal> decode_weak_factory_{this};

      Why was this working? Was it a bug?

    • See all the comments inside of the class (which also need updating). The code is very careful to HasPendingActivity() remains true while outstanding tasks are pending.

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc:

    • Patch Set #1, Line 286: // See OnContextDestroyed(); WeakPtrs must be invalidated ahead of GC.

      Fix or remove comment now?

    • Patch Set #1, Line 475: // WeakPtrs need special consideration when used with a garbage collected

      Fix/remove comment.

    • Patch Set #1, Line 486: // WARNING: All pending WeakPtr bindings must be tracked here. I.e., all

      Fix / remove comment.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 1
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 04:35:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kentaro Hara <har...@chromium.org>

Kentaro Hara (Gerrit)

unread,
Nov 23, 2023, 2:07:45 AM11/23/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Michael Lippautz, Omer Katz.

Patch set 1:-Code-Review

The change is no longer submittable: Code-Owners and Code-Review are unsatisfied now.

View Change

1 comment:

  • Patchset:

    • Patch Set #1:

      Would you help me understand why we need to explicitly invalidate the weak pointers? Why is it not okay to wait for a GC to clear the weak pointers?

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 1
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 07:07:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Michael Lippautz (Gerrit)

unread,
Nov 23, 2023, 2:49:12 AM11/23/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Kentaro Hara, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Omer Katz.

View Change

2 comments:

  • Patchset:

    • Patch Set #1:

      This is not fixing an immediate issue, is it? Can we add the traits right away since you are already looking at this code?

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.h:

    • See all the comments inside of the class (which also need updating). […]

      HPA() is ignored when the ExecutionContext is destroyed. Is this working as intended?

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 1
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 07:49:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Comment-In-Reply-To: Kentaro Hara <har...@chromium.org>

Omer Katz (Gerrit)

unread,
Nov 23, 2023, 4:26:46 AM11/23/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Omer Katz.

Omer Katz uploaded patch set #2 to this change.

View Change

Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal

Bug: chromium:1246423
Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
---
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
M third_party/blink/renderer/platform/heap/weak_cell.h
3 files changed, 46 insertions(+), 33 deletions(-)

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 2

Omer Katz (Gerrit)

unread,
Nov 23, 2023, 4:27:28 AM11/23/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Kentaro Hara, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Michael Lippautz.

View Change

7 comments:

  • Patchset:

    • Patch Set #1:

      Would you help me understand why we need to explicitly invalidate the weak pointers? Why is it not o […]

      That is a valid question, but I can't answer it. I'm just trying to replace a known risky WeakPtrFactory with a safe WeakCellFactory to eliminate the risk.
      Perhaps someone more familiar with this area can pick this up as a followup to rethink whether invalidation can be avoided.

    • Patch Set #1:

      This is not fixing an immediate issue, is it? Can we add the traits right away since you are already […]

      I tried that originally and it wasn't a 5 minute detour. I'll take another look at it today.

    • Patch Set #1:

      Please update the comments before submitting. […]

      Acknowledged

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.h:

    • HPA() is ignored when the ExecutionContext is destroyed. […]

      Kentaro were you asking about why HPA was working or why WeakPtrFactory was working?
      WeakPtrFactory is generally unsafe for GCed types, but 1) it would be very rare for it actually crash, and 2) I assume the rest of this class was crafted to mitigate the risk as much as possible (thus making bugs even more rare).

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc:

    • Patch Set #1, Line 286: // See OnContextDestroyed(); WeakPtrs must be invalidated ahead of GC.

      Fix or remove comment now?

    • Done

    • Patch Set #1, Line 475: // WeakPtrs need special consideration when used with a garbage collected

      Fix/remove comment.

    • Done

    • Patch Set #1, Line 486: // WARNING: All pending WeakPtr bindings must be tracked here. I.e., all

      Fix / remove comment.

    • Done

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 2
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 09:27:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kentaro Hara <har...@chromium.org>
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>

Kentaro Hara (Gerrit)

unread,
Nov 23, 2023, 4:44:38 AM11/23/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Michael Lippautz, Omer Katz.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      In theory, base::WeakPtrFactory should not be needed for Oilpan types, and we removed them from Blink when we introduced Oilpan. I don't object to landing this CL and revisiting it later but I think we should get there 😊

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 2
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 09:44:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Omer Katz (Gerrit)

unread,
Nov 23, 2023, 6:02:15 AM11/23/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org

Attention is currently required from: Dale Curtis, Michael Lippautz, Omer Katz.

Omer Katz uploaded patch set #3 to this change.

View Change

The following approvals got outdated and were removed: Commit-Queue+1 by Omer Katz

Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal

Bug: chromium:1246423
Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
---
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
M third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h
M third_party/blink/renderer/platform/heap/weak_cell.h
4 files changed, 53 insertions(+), 40 deletions(-)

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3

Omer Katz (Gerrit)

unread,
Nov 23, 2023, 6:41:06 AM11/23/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Kentaro Hara, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Michael Lippautz.

View Change

2 comments:

  • Patchset:

    • Patch Set #1:

      I tried that originally and it wasn't a 5 minute detour. I'll take another look at it today.

      Done

  • Patchset:

    • Patch Set #2:

      In theory, base::WeakPtrFactory should not be needed for Oilpan types, and we removed them from Blin […]

      I suppose people had a usecase that required invalidating pointers to live objects, but I can't say for sure. If we want to re-evaluate WeakPtrFactory here, we should file an issue against the owners of this code so they can investigate this further.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 11:40:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kentaro Hara <har...@chromium.org>
Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>
Comment-In-Reply-To: Omer Katz <omer...@chromium.org>

Kentaro Hara (Gerrit)

unread,
Nov 23, 2023, 7:30:35 AM11/23/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Michael Lippautz, Omer Katz.

View Change

2 comments:

  • Patchset:

    • Patch Set #2:

      I suppose people had a usecase that required invalidating pointers to live objects, but I can't say […]

      But here's a question: Do we really need the WeakCell infra? When we introduced Oilpan, we intentionally didn't introduce it and instead removed WeakPtrFactory.

      I'm okay with introducing if there's a use case but want to understand the reasoning.

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.h:

    • Kentaro were you asking about why HPA was working or why WeakPtrFactory was working? […]

      I was asking why WeakPtrFactory was working. Now I understand the situation, thanks!

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 12:30:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kentaro Hara <har...@chromium.org>
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>

Omer Katz (Gerrit)

unread,
Nov 23, 2023, 8:20:37 AM11/23/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Kentaro Hara, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Michael Lippautz.

View Change

2 comments:

  • Patchset:

    • Patch Set #2:

      But here's a question: Do we really need the WeakCell infra? When we introduced Oilpan, we intention […]

      I see. However we are not introducing it now. It already exists and this CL is simply extending the usage.
      See https://mail.google.com/mail/u/0/?source=sync&tf=1&view=pt&th=18a8f7c31fbbd2d7&search=all&msg and crbug.com/1485318 for the discussion that led to its introduction (the bug mentions an issue with delayed invalidation due to delayed finalization in Oilpan).

      If eventually invalidation is no longer needed and all usages are removed, we could also get rid of `WeakCell`.

      I think the question of whether invalidation is actually needed/desired with Oilpan is a valid question, but also orthogonal to this CL.

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.h:

    • I was asking why WeakPtrFactory was working. […]

      Acknowledged

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 13:20:29 +0000

Kentaro Hara (Gerrit)

unread,
Nov 23, 2023, 8:26:39 AM11/23/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Michael Lippautz, Omer Katz.

Patch set 3:Code-Review +1

View Change

1 comment:

  • Patchset:

    • Patch Set #3:

      ok, LGTM. Please file a bug and ask the owner to see if we can remove WeakCellFactory.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 13:26:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Omer Katz (Gerrit)

unread,
Nov 23, 2023, 9:07:23 AM11/23/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Michael Lippautz.

View Change

1 comment:

  • Patchset:

    • Patch Set #3:

      ok, LGTM. Please file a bug and ask the owner to see if we can remove WeakCellFactory.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Nov 2023 14:07:12 +0000

Omer Katz (Gerrit)

unread,
Nov 27, 2023, 2:46:02 AM11/27/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Michael Lippautz.

View Change

1 comment:

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 07:45:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Michael Lippautz (Gerrit)

unread,
Nov 27, 2023, 3:02:14 AM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Omer Katz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • Patch Set #3, Line 70: bool

      Why is that moved here?

      Are we missing on converting a `CrossThreadHandle` to an `UnwrappingCrossThreadHandle`?

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 08:02:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Omer Katz (Gerrit)

unread,
Nov 27, 2023, 4:15:49 AM11/27/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Michael Lippautz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • Why is that moved here? […]

      Yes.
      When used with `AsyncCal().Then()` (like in `image_decoder_external.cc`) the off-thread callback that we execute never sees the `CrossThreadHandle`. My understanding is that `CrossThreadHandle` assumed it would be passed to the callback so that the callback can explicitly call `MakeUnwrappingCrossThreadHandle`. However, in this case, the `AsyncCall` infra keeps the `CrossThreadHandle` hidden and only tries to unwrap it once when triggering the `Then` callback.
      I didn't think that adding specialization in `AsyncCall().Then()` for `CrossThreadHandle` was a viable solution here.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 09:15:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>

Michael Lippautz (Gerrit)

unread,
Nov 27, 2023, 4:28:40 AM11/27/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Omer Katz, Kentaro Hara

Attention is currently required from: Dale Curtis, Daniel Cheng, Omer Katz.

Omer Katz has uploaded this change for review.

View Change

Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal

Bug: chromium:1246423
Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
---
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
M third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h
M third_party/blink/renderer/platform/heap/weak_cell.h
4 files changed, 53 insertions(+), 40 deletions(-)


To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>

Michael Lippautz (Gerrit)

unread,
Nov 27, 2023, 4:28:45 AM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Daniel Cheng, Omer Katz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • Yes. […]

      Can you start with passing an unwrapping handle right away?

      If we soften the restriction around non-wrapping handle then we may as well remove it.

      I remember that we wanted the difference initially but it came up repeatedly as a burden so far. @dch...@chromium.org for input.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 09:28:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>
Comment-In-Reply-To: Omer Katz <omer...@chromium.org>

Omer Katz (Gerrit)

unread,
Nov 27, 2023, 9:54:52 AM11/27/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org

Attention is currently required from: Dale Curtis, Daniel Cheng, Kentaro Hara, Omer Katz.

Omer Katz uploaded patch set #4 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+1 by Kentaro Hara

The change is no longer submittable: Code-Review is unsatisfied now.

Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal

Bug: chromium:1246423
Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
---
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
M third_party/blink/renderer/platform/heap/weak_cell.h
3 files changed, 45 insertions(+), 32 deletions(-)

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 4
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>

Omer Katz (Gerrit)

unread,
Nov 27, 2023, 9:57:05 AM11/27/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Daniel Cheng, Kentaro Hara, Michael Lippautz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • Can you start with passing an unwrapping handle right away? […]

      Done.

      Personally, since `GetOnCreationThread` checks that we're on the right thread, I think it would be just as safe to merge CrossThreadHandle and UnwrappingCrossThreadHandle.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 3
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 14:56:56 +0000

Michael Lippautz (Gerrit)

unread,
Nov 27, 2023, 10:20:59 AM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Daniel Cheng, Kentaro Hara, Omer Katz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • Done. […]

      Yeah, by now I think that the benefits of differentiating here are not in relation to the code cruft added. Let's wait for Daniel.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 4
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 15:20:48 +0000

Dale Curtis (Gerrit)

unread,
Nov 27, 2023, 12:49:22 PM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Daniel Cheng, Kentaro Hara, Michael Lippautz, Omer Katz.

View Change

3 comments:

  • Patchset:

    • Patch Set #2:

      I see. However we are not introducing it now. […]

      This class cancels what it can (AbortFlag) and ignores the rest (WeakPtr) after certain operations given the high memory / cpu cost of decoding operations.

      A mostly equivalent approach would be a pair of sequence counters which are checked on operation return, but there may also be some lifetime issues that I don't recall properly. I left a similar comment at https://bugs.chromium.org/p/chromium/issues/detail?id=1504805#c1

      This is a pretty common non-Blink pattern, so I like the idea of WeakCell, but if it's not something the Blink team wants, we can try to replace the usage and see if anything explodes.

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.h:

    • Acknowledged

      Re: Michael's HPA() question: ContextDestroyed() invalidates the WeakPointers and prevents any new ones from being generated.

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc:

    • Patch Set #4, Line 153: // If the context is already destroyed we will never get an OnContextDestroyed

      I don't think this comment is as important anymore? You could say `ImageDecoder requires an active context to operate correctly.` or just delete the comment entirely now I think.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 4
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 17:49:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kentaro Hara <har...@chromium.org>
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>

Daniel Cheng (Gerrit)

unread,
Nov 27, 2023, 1:35:53 PM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Michael Lippautz, Omer Katz.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      But here's a question: Do we really need the WeakCell infra? When we introduced Oilpan, we intentionally didn't introduce it and instead removed WeakPtrFactory.


    • > I'm okay with introducing if there's a use case but want to understand the reasoning.

    • I think it's relatively rare to need invalidation, but there are some cases where it's useful, and people have been getting around it by just using WeakPtrFactory (often unsafely). So it would be better to ban + have a safe pattern.

      If that safe pattern is "WeakPtrFactory must be paired with a pre finalizer", that'd work for me too. But it doesn't seem like it'd be simpler/easier to reason about, at least from this media code.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 4
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 18:35:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Comment-In-Reply-To: Kentaro Hara <har...@chromium.org>
Comment-In-Reply-To: Omer Katz <omer...@chromium.org>

Omer Katz (Gerrit)

unread,
Nov 27, 2023, 1:45:40 PM11/27/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Michael Lippautz, Omer Katz.

Omer Katz uploaded patch set #5 to this change.

View Change

Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal


Bug: chromium:1246423
Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
---
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
M third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
M third_party/blink/renderer/platform/heap/weak_cell.h
3 files changed, 44 insertions(+), 33 deletions(-)

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5

Omer Katz (Gerrit)

unread,
Nov 27, 2023, 1:46:03 PM11/27/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Michael Lippautz.

View Change

1 comment:

  • File third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc:

    • I don't think this comment is as important anymore? You could say `ImageDecoder requires an active c […]

      Done

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 18:45:55 +0000

Daniel Cheng (Gerrit)

unread,
Nov 27, 2023, 2:11:00 PM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Kentaro Hara, Michael Lippautz, Omer Katz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • Yeah, by now I think that the benefits of differentiating here are not in relation to the code cruft […]

      Are you OK with MakeCrossThreadHandle() automatically unwrapping if it's used as the receiver pointer? I think that's the one context that there's clearly an intent to unwrap it for calls. We'd leave all other behaviour as-is, right?

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 19:10:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Michael Lippautz (Gerrit)

unread,
Nov 27, 2023, 2:29:13 PM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Daniel Cheng, Kentaro Hara, Omer Katz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • Are you OK with MakeCrossThreadHandle() automatically unwrapping if it's used as the receiver pointe […]

      How would we do that automatically? Idea generally sounds good.

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 19:29:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>

Daniel Cheng (Gerrit)

unread,
Nov 27, 2023, 4:00:26 PM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Kentaro Hara, Michael Lippautz.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 21:00:15 +0000

Michael Lippautz (Gerrit)

unread,
Nov 27, 2023, 4:04:55 PM11/27/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Daniel Cheng, Kentaro Hara, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Daniel Cheng, Kentaro Hara, Omer Katz.

Patch set 5:Code-Review +1

View Change

2 comments:

  • Patchset:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

    • We can specialize `UnderlyingReceiverType`, but it would be even better if we could just make it wor […]

      Thanks.

      Omer, can you file a follow up bug. (Doesn't need to be fixed right away.)

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Nov 2023 21:04:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Omer Katz (Gerrit)

unread,
Nov 28, 2023, 4:07:32 AM11/28/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Michael Lippautz, Daniel Cheng, Kentaro Hara, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Daniel Cheng, Kentaro Hara.

View Change

1 comment:

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Tue, 28 Nov 2023 09:07:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Omer Katz (Gerrit)

unread,
Nov 28, 2023, 4:15:00 AM11/28/23
to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Michael Lippautz, Daniel Cheng, Kentaro Hara, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Daniel Cheng, Kentaro Hara.

View Change

1 comment:

  • File third_party/blink/renderer/platform/heap/cross_thread_handle_internal.h:

To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
Gerrit-Change-Number: 5049885
Gerrit-PatchSet: 5
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Tue, 28 Nov 2023 09:14:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Kentaro Hara (Gerrit)

unread,
Nov 28, 2023, 5:57:22 AM11/28/23
to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Michael Lippautz, Daniel Cheng, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Daniel Cheng, Omer Katz.

Patch set 5:Code-Review +1

View Change

    To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
    Gerrit-Change-Number: 5049885
    Gerrit-PatchSet: 5
    Gerrit-Owner: Omer Katz <omer...@chromium.org>
    Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Omer Katz <omer...@chromium.org>
    Gerrit-Comment-Date: Tue, 28 Nov 2023 10:57:13 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Omer Katz (Gerrit)

    unread,
    Nov 28, 2023, 6:09:49 AM11/28/23
    to blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Michael Lippautz, Daniel Cheng, Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Daniel Cheng.

    Patch set 5:Commit-Queue +2

    View Change

      To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
      Gerrit-Change-Number: 5049885
      Gerrit-PatchSet: 5
      Gerrit-Owner: Omer Katz <omer...@chromium.org>
      Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
      Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
      Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
      Gerrit-CC: Dale Curtis <dalec...@chromium.org>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 28 Nov 2023 11:09:39 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Chromium LUCI CQ (Gerrit)

      unread,
      Nov 28, 2023, 6:14:01 AM11/28/23
      to Omer Katz, blink-...@chromium.org, feature-me...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org, Kentaro Hara, Michael Lippautz, Daniel Cheng, Dale Curtis, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change

      Approvals: Kentaro Hara: Looks good to me Michael Lippautz: Looks good to me Omer Katz: Commit
      Replace WeakPtrFactory with WeakCellFactory in ImageDecoderExternal

      Bug: chromium:1246423
      Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5049885
      Commit-Queue: Omer Katz <omer...@chromium.org>
      Reviewed-by: Michael Lippautz <mlip...@chromium.org>
      Reviewed-by: Kentaro Hara <har...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1229836}

      ---
      M third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
      M third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
      M third_party/blink/renderer/platform/heap/weak_cell.h
      3 files changed, 44 insertions(+), 33 deletions(-)


      To view, visit change 5049885. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I8d7897546e3bc66122b5799575e09a3172a5b84b
      Gerrit-Change-Number: 5049885
      Gerrit-PatchSet: 6
      Gerrit-Owner: Omer Katz <omer...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
      Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
      Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
      Reply all
      Reply to author
      Forward
      0 new messages