[AdTracker] Expose GetAdScriptInStack and GetAncestry [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Mar 11, 2026, 5:03:59 PM (yesterday) Mar 11
to Yao Xiao, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading...@chromium.org

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/probe/async_task_context.h
Line 61, Patchset 1 (Latest): const std::optional<AdScriptOrContext>& ad_script_or_context() const {
AI Code Reviewer . unresolved

nit: Blink Style Guide: Naming - Use 'CamelCase' for all function names. Since the capitalized name `AdScriptOrContext` would collide with the return type name, prefix it with 'Get'. Consider renaming this getter to `GetAdScriptOrContext()` to match the CamelCase convention used by other methods in this class (e.g., `Schedule`, `Cancel`, `Id`).

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Open in Gerrit

Related details

Attention set is empty
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: I521a1ca8605e70a37fe03b99fd5cc3da4055639f
Gerrit-Change-Number: 7658288
Gerrit-PatchSet: 1
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 21:03:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yao Xiao (Gerrit)

unread,
Mar 11, 2026, 5:48:45 PM (yesterday) Mar 11
to Josh Karlin, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
Attention needed from Josh Karlin

Yao Xiao voted and added 1 comment

Votes added by Yao Xiao

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Yao Xiao . resolved

jkarlin@: PTAL. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Josh Karlin
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: I521a1ca8605e70a37fe03b99fd5cc3da4055639f
Gerrit-Change-Number: 7658288
Gerrit-PatchSet: 2
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Josh Karlin <jka...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 21:48:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Josh Karlin (Gerrit)

unread,
9:55 AM (11 hours ago) 9:55 AM
to Yao Xiao, Josh Karlin, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
Attention needed from Yao Xiao

Josh Karlin added 1 comment

Commit Message
Line 26, Patchset 2 (Latest):- Exposing `GetAdScriptInStack` allows us to retrieve a single script
without reconstructing the entire ancestry chain immediately. This
Josh Karlin . unresolved

You're effectively returning an identifier that can be turned back into an ancestry object later. I'm supportive of the idea if the cost of creating the ancestry is in fact prohibitive (which I'm not yet convinced of).

I think in the case of an ad context however, we want more than just AdExecutionContext right? Like, I'd think we want to know that it's an ad frame and what script created that ad frame and its call chain, or its matching rule.

That seems like a change to AdProvenance and IsAdScriptInStack that we should make prior to this CL.

Then, we can talk about just using that full AdAncestry everywhere, or if necessary, providing some sort of AdAncestryIdentifier or a partially-filled AdAncestry object that can later be fleshed out.

In either case, I think we'll only need one API and not two.

Open in Gerrit

Related details

Attention is currently required from:
  • Yao Xiao
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: I521a1ca8605e70a37fe03b99fd5cc3da4055639f
Gerrit-Change-Number: 7658288
Gerrit-PatchSet: 2
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Yao Xiao <yao...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Mar 2026 13:55:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yao Xiao (Gerrit)

unread,
12:33 PM (8 hours ago) 12:33 PM
to Josh Karlin, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading...@chromium.org
Attention needed from Josh Karlin

Yao Xiao added 1 comment

Commit Message
Line 26, Patchset 2 (Latest):- Exposing `GetAdScriptInStack` allows us to retrieve a single script
without reconstructing the entire ancestry chain immediately. This
Josh Karlin . resolved

You're effectively returning an identifier that can be turned back into an ancestry object later. I'm supportive of the idea if the cost of creating the ancestry is in fact prohibitive (which I'm not yet convinced of).

I think in the case of an ad context however, we want more than just AdExecutionContext right? Like, I'd think we want to know that it's an ad frame and what script created that ad frame and its call chain, or its matching rule.

That seems like a change to AdProvenance and IsAdScriptInStack that we should make prior to this CL.

Then, we can talk about just using that full AdAncestry everywhere, or if necessary, providing some sort of AdAncestryIdentifier or a partially-filled AdAncestry object that can later be fleshed out.

In either case, I think we'll only need one API and not two.

Yao Xiao

As discussed offline, this CL bundles too many refactorings and has become difficult to review. I'm going to abandon it.

I'll make a narrowly scoped CL for my immediate need first, and will revisit these refactorings later as smaller, separate patches.

Open in Gerrit

Related details

Attention is currently required from:
  • Josh Karlin
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: I521a1ca8605e70a37fe03b99fd5cc3da4055639f
Gerrit-Change-Number: 7658288
Gerrit-PatchSet: 2
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Josh Karlin <jka...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Mar 2026 16:33:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Josh Karlin <jka...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Yao Xiao (Gerrit)

unread,
12:33 PM (8 hours ago) 12:33 PM
to Josh Karlin, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Nate Chapin, blink-revi...@chromium.org, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-re...@chromium.org, loading...@chromium.org

Yao Xiao abandoned this change.

View Change

Abandoned

Yao Xiao abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: abandon
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages