Add HasTranscriptsForFrame() to avoid un-needed copies of transcripts [chromium/src : main]

0 views
Skip to first unread message

Ahmed Moussa (Gerrit)

unread,
Mar 11, 2026, 3:08:10 PMMar 11
to Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Muyao Xu

Ahmed Moussa added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Ahmed Moussa . resolved

Hello Muyao 😊, PTAL thanks

Open in Gerrit

Related details

Attention is currently required from:
  • Muyao Xu
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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
Gerrit-Change-Number: 7658853
Gerrit-PatchSet: 1
Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
Gerrit-Reviewer: Muyao Xu <muy...@google.com>
Gerrit-Attention: Muyao Xu <muy...@google.com>
Gerrit-Comment-Date: Wed, 11 Mar 2026 19:08:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ahmed Moussa (Gerrit)

unread,
Mar 11, 2026, 3:09:14 PMMar 11
to Michael Crouse, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Michael Crouse and Muyao Xu

Ahmed Moussa added 1 comment

Patchset-level comments
Ahmed Moussa . resolved

Hello Michael, PTAL at `components/optimization_guide/content/browser/*`, thanks

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Crouse
  • Muyao Xu
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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
Gerrit-Change-Number: 7658853
Gerrit-PatchSet: 1
Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
Gerrit-Reviewer: Michael Crouse <mcr...@chromium.org>
Gerrit-Reviewer: Muyao Xu <muy...@google.com>
Gerrit-Attention: Muyao Xu <muy...@google.com>
Gerrit-Attention: Michael Crouse <mcr...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 19:09:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Muyao Xu (Gerrit)

unread,
Mar 11, 2026, 3:35:08 PMMar 11
to Ahmed Moussa, Michael Crouse, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Ahmed Moussa and Michael Crouse

Muyao Xu voted and added 1 comment

Votes added by Muyao Xu

Code-Review+1

1 comment

File components/optimization_guide/content/browser/media_transcript_provider.h
Line 40, Patchset 2: // `RenderFrameHost`.
Muyao Xu . resolved

nit: given `rfh`

Open in Gerrit

Related details

Attention is currently required from:
  • Ahmed Moussa
  • Michael Crouse
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
    Gerrit-Change-Number: 7658853
    Gerrit-PatchSet: 3
    Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
    Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
    Gerrit-Reviewer: Michael Crouse <mcr...@chromium.org>
    Gerrit-Reviewer: Muyao Xu <muy...@google.com>
    Gerrit-Attention: Michael Crouse <mcr...@chromium.org>
    Gerrit-Attention: Ahmed Moussa <ahmed...@google.com>
    Gerrit-Comment-Date: Wed, 11 Mar 2026 19:34:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ahmed Moussa (Gerrit)

    unread,
    Mar 12, 2026, 2:03:18 PMMar 12
    to Abigail Klein, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Abigail Klein

    Ahmed Moussa added 1 comment

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Ahmed Moussa . resolved

    Hello Abigail 😊, PTAL, thanks.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Abigail Klein
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
    Gerrit-Change-Number: 7658853
    Gerrit-PatchSet: 3
    Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
    Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
    Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
    Gerrit-Reviewer: Muyao Xu <muy...@google.com>
    Gerrit-Attention: Abigail Klein <abigai...@google.com>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 18:03:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Abigail Klein (Gerrit)

    unread,
    Mar 12, 2026, 5:14:14 PMMar 12
    to Ahmed Moussa, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Ahmed Moussa

    Abigail Klein added 1 comment

    File chrome/browser/glic/media/media_transcript_provider_impl.cc
    Line 48, Patchset 3 (Latest): content::RenderFrameHost* rfh) {
    Abigail Klein . unresolved

    The fact that this is a pointer means that the memory could be released before the pointer is used. Can we either pass a safe pointer or a reference? I know that right now this is just called by PageContentMetadataObserver where we know that rfh exists, but I'm worried about a possible future case where the caller might be passing a dangling pointer.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ahmed Moussa
    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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
      Gerrit-Change-Number: 7658853
      Gerrit-PatchSet: 3
      Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
      Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
      Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
      Gerrit-Reviewer: Muyao Xu <muy...@google.com>
      Gerrit-Attention: Ahmed Moussa <ahmed...@google.com>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 21:14:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ahmed Moussa (Gerrit)

      unread,
      Mar 13, 2026, 2:37:56 PMMar 13
      to Abigail Klein, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Abigail Klein

      Ahmed Moussa added 1 comment

      File chrome/browser/glic/media/media_transcript_provider_impl.cc
      Line 48, Patchset 3: content::RenderFrameHost* rfh) {
      Abigail Klein . resolved

      The fact that this is a pointer means that the memory could be released before the pointer is used. Can we either pass a safe pointer or a reference? I know that right now this is just called by PageContentMetadataObserver where we know that rfh exists, but I'm worried about a possible future case where the caller might be passing a dangling pointer.

      Ahmed Moussa

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Abigail Klein
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not 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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
        Gerrit-Change-Number: 7658853
        Gerrit-PatchSet: 4
        Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
        Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
        Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
        Gerrit-Reviewer: Muyao Xu <muy...@google.com>
        Gerrit-Attention: Abigail Klein <abigai...@google.com>
        Gerrit-Comment-Date: Fri, 13 Mar 2026 18:37:46 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Abigail Klein <abigai...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Abigail Klein (Gerrit)

        unread,
        Mar 16, 2026, 11:33:11 AMMar 16
        to Ahmed Moussa, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org
        Attention needed from Ahmed Moussa

        Abigail Klein voted and added 1 comment

        Votes added by Abigail Klein

        Code-Review+1

        1 comment

        File chrome/browser/glic/media/media_transcript_provider_impl.cc
        Line 48, Patchset 3: content::RenderFrameHost* rfh) {
        Abigail Klein . unresolved

        The fact that this is a pointer means that the memory could be released before the pointer is used. Can we either pass a safe pointer or a reference? I know that right now this is just called by PageContentMetadataObserver where we know that rfh exists, but I'm worried about a possible future case where the caller might be passing a dangling pointer.

        Ahmed Moussa

        Done

        Abigail Klein

        Sorry for churn--I see now that the rfh pointer is passed around everywhere else in this file. So I think you can actually do what you want with respect to pointer vs reference; if you want to change it back to pointer that's fine.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ahmed Moussa
        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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
        Gerrit-Change-Number: 7658853
        Gerrit-PatchSet: 4
        Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
        Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
        Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
        Gerrit-Reviewer: Muyao Xu <muy...@google.com>
        Gerrit-Attention: Ahmed Moussa <ahmed...@google.com>
        Gerrit-Comment-Date: Mon, 16 Mar 2026 15:33:05 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Abigail Klein <abigai...@google.com>
        Comment-In-Reply-To: Ahmed Moussa <ahmed...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Ahmed Moussa (Gerrit)

        unread,
        Mar 16, 2026, 3:51:27 PMMar 16
        to Abigail Klein, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org

        Ahmed Moussa added 1 comment

        File chrome/browser/glic/media/media_transcript_provider_impl.cc
        Line 48, Patchset 3: content::RenderFrameHost* rfh) {
        Abigail Klein . resolved

        The fact that this is a pointer means that the memory could be released before the pointer is used. Can we either pass a safe pointer or a reference? I know that right now this is just called by PageContentMetadataObserver where we know that rfh exists, but I'm worried about a possible future case where the caller might be passing a dangling pointer.

        Ahmed Moussa

        Done

        Abigail Klein

        Sorry for churn--I see now that the rfh pointer is passed around everywhere else in this file. So I think you can actually do what you want with respect to pointer vs reference; if you want to change it back to pointer that's fine.

        Ahmed Moussa

        Acknowledged

        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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
          Gerrit-Change-Number: 7658853
          Gerrit-PatchSet: 4
          Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
          Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Muyao Xu <muy...@google.com>
          Gerrit-Comment-Date: Mon, 16 Mar 2026 19:51:17 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          open
          diffy

          Ahmed Moussa (Gerrit)

          unread,
          Mar 16, 2026, 3:51:40 PMMar 16
          to Abigail Klein, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org

          Ahmed Moussa added 1 comment

          Patchset-level comments
          File-level comment, Patchset 4 (Latest):
          Ahmed Moussa . resolved

          thanks for reviewing

          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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
          Gerrit-Change-Number: 7658853
          Gerrit-PatchSet: 4
          Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
          Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Muyao Xu <muy...@google.com>
          Gerrit-Comment-Date: Mon, 16 Mar 2026 19:51:31 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          open
          diffy

          Ahmed Moussa (Gerrit)

          unread,
          Mar 16, 2026, 3:51:58 PMMar 16
          to Abigail Klein, Muyao Xu, Chromium LUCI CQ, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org

          Ahmed Moussa 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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
          Gerrit-Change-Number: 7658853
          Gerrit-PatchSet: 4
          Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
          Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Muyao Xu <muy...@google.com>
          Gerrit-Comment-Date: Mon, 16 Mar 2026 19:51:48 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          Mar 16, 2026, 7:11:24 PMMar 16
          to Ahmed Moussa, Abigail Klein, Muyao Xu, chromium...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, dewitt...@chromium.org, feature-me...@chromium.org, mfoltz+wa...@chromium.org

          Chromium LUCI CQ submitted the change

          Change information

          Commit message:
          Add HasTranscriptsForFrame() to avoid un-needed copies of transcripts

          Change page_content_metadata_observer to call HasTranscriptsForFrame()
          instead of GetTranscriptsForFrame() to avoid un-needed copies of
          transcripts.
          Bug: 483422796
          Change-Id: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
          Reviewed-by: Muyao Xu <muy...@google.com>
          Commit-Queue: Ahmed Moussa <ahmed...@google.com>
          Reviewed-by: Abigail Klein <abigai...@google.com>
          Cr-Commit-Position: refs/heads/main@{#1600175}
          Files:
          • M chrome/browser/glic/media/glic_media_context.cc
          • M chrome/browser/glic/media/glic_media_context.h
          • M chrome/browser/glic/media/glic_media_context_unittest.cc
          • M chrome/browser/glic/media/media_transcript_provider_impl.cc
          • M chrome/browser/glic/media/media_transcript_provider_impl.h
          • M chrome/browser/glic/media/media_transcript_provider_impl_unittest.cc
          • M components/optimization_guide/content/browser/media_transcript_provider.h
          • M components/optimization_guide/content/browser/mock_media_transcript_provider.h
          • M components/optimization_guide/content/browser/page_content_metadata_observer.cc
          Change size: M
          Delta: 9 files changed, 63 insertions(+), 1 deletion(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Muyao Xu, +1 by Abigail Klein
          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: Iefdb61c342b436cf06e4f6d6b0e0266bc55d0f63
          Gerrit-Change-Number: 7658853
          Gerrit-PatchSet: 5
          Gerrit-Owner: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Abigail Klein <abigai...@google.com>
          Gerrit-Reviewer: Ahmed Moussa <ahmed...@google.com>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Muyao Xu <muy...@google.com>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages