Pass the AgentClusterKey from the browser process [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Oct 14, 2025, 12:08:41 PMOct 14
to Camille Lamy, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Hiroki Nakagawa, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org

AI Code Reviewer added 3 comments

File third_party/blink/renderer/core/execution_context/agent.h
Line 100, Patchset 2 (Latest): AgentClusterKey* agent_cluster_key);
AI Code Reviewer . unresolved

Blink Style Guide: Naming - May leave obvious parameter names out of function declarations. The parameter name `agent_cluster_key` can be omitted from the function declaration in the header file as the type `AgentClusterKey*` is self-descriptive.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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)_

File third_party/blink/renderer/core/execution_context/window_agent.h
Line 38, Patchset 2 (Latest): WindowAgent(AgentGroupScheduler& agent_group_scheduler,
AI Code Reviewer . unresolved

Blink Style Guide: Naming - May leave obvious parameter names out of function declarations. The parameter name `agent_cluster_key` can be omitted from the function declaration in the header file as the type `AgentClusterKey*` is self-descriptive.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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)_

File third_party/blink/renderer/core/execution_context/window_agent_factory.h
Line 42, Patchset 2 (Latest): WindowAgent* GetAgentForAgentClusterKey(
AI Code Reviewer . unresolved

Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. Consider using an enum for `has_potential_universal_access_privilege` to improve clarity at call sites, for example: `enum class UniversalAccessPrivilege { kNo, kYes };`.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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: Ibb98071005816e53e766fbcbe3fbcb642ee17592
Gerrit-Change-Number: 7041044
Gerrit-PatchSet: 2
Gerrit-Owner: Camille Lamy <cl...@chromium.org>
Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Comment-Date: Tue, 14 Oct 2025 16:08:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Camille Lamy (Gerrit)

unread,
Oct 24, 2025, 10:38:57 AMOct 24
to AI Code Reviewer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Hiroki Nakagawa, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org

Camille Lamy added 3 comments

File third_party/blink/renderer/core/execution_context/agent.h
Line 100, Patchset 2: AgentClusterKey* agent_cluster_key);
AI Code Reviewer . resolved

Blink Style Guide: Naming - May leave obvious parameter names out of function declarations. The parameter name `agent_cluster_key` can be omitted from the function declaration in the header file as the type `AgentClusterKey*` is self-descriptive.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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)_

Camille Lamy

Done

File third_party/blink/renderer/core/execution_context/window_agent.h
Line 38, Patchset 2: WindowAgent(AgentGroupScheduler& agent_group_scheduler,
AI Code Reviewer . resolved

Blink Style Guide: Naming - May leave obvious parameter names out of function declarations. The parameter name `agent_cluster_key` can be omitted from the function declaration in the header file as the type `AgentClusterKey*` is self-descriptive.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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)_

Camille Lamy

Done

File third_party/blink/renderer/core/execution_context/window_agent_factory.h
Line 42, Patchset 2: WindowAgent* GetAgentForAgentClusterKey(
AI Code Reviewer . resolved

Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. Consider using an enum for `has_potential_universal_access_privilege` to improve clarity at call sites, for example: `enum class UniversalAccessPrivilege { kNo, kYes };`.

_To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **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)_

Camille Lamy

Acknowledged

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 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: Ibb98071005816e53e766fbcbe3fbcb642ee17592
    Gerrit-Change-Number: 7041044
    Gerrit-PatchSet: 12
    Gerrit-Owner: Camille Lamy <cl...@chromium.org>
    Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Comment-Date: Fri, 24 Oct 2025 14:38:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Camille Lamy (Gerrit)

    unread,
    Oct 24, 2025, 11:27:58 AMOct 24
    to Alex Moshchuk, Daniel Cheng, AI Code Reviewer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Hiroki Nakagawa, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org
    Attention needed from Alex Moshchuk and Daniel Cheng

    Camille Lamy added 4 comments

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Camille Lamy . resolved

    @Alex: PTAL. This is moving the agent cluster decision in the browser process and passing it to the renderer process. I have taken the option to try to use the AgentClusterKey from SiteInfo as much as possible, as I think we want to move to using it most of the time eventually. However, if we want to keep closer to the current code, we could also just check whether we have an origin-keyed/site-keyed/COI key and always update the origin/site of the key.

    File content/browser/renderer_host/navigation_request.cc
    Line 4011, Patchset 13 (Latest): // Now build the appropriate AgentClusterKey for commit, starting with the
    Camille Lamy . unresolved

    I have been considering moving all the code below to SiteInfo, as it essentially undoes all the special cases of GetAgentClusterKeyForURL, so maybe having the two in the same place to compare would be nice.

    Line 4136, Patchset 13 (Latest): bool is_navigation_to_existing_entry =
    Camille Lamy . unresolved

    I still have one test failing for this specific case. I think it's a case of a subframe navigation to an existing subframe NavigationEntry. I'm not sure how to write the condition for it.

    File third_party/blink/public/web/web_agent_cluster_key.h
    Line 23, Patchset 13 (Latest): mojom::CrossOriginIsolationMode cross_origin_isolation_mode)
    Camille Lamy . unresolved

    The presubmit checks complain about non-Blink mojom usage, but since this is the public interface that seems to be the correct thing to do to eventually translate into Blink mojom types. I'm not sure where I need to authorize this as I would have imagined that third_party/blink/public/web would not be covered by the check.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    • Daniel Cheng
    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: Ibb98071005816e53e766fbcbe3fbcb642ee17592
      Gerrit-Change-Number: 7041044
      Gerrit-PatchSet: 13
      Gerrit-Owner: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Fri, 24 Oct 2025 15:27:41 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Oct 27, 2025, 7:09:19 PMOct 27
      to Camille Lamy, Alex Moshchuk, Daniel Cheng, AI Code Reviewer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Hiroki Nakagawa, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org
      Attention needed from Alex Moshchuk and Camille Lamy

      Daniel Cheng added 10 comments

      File content/browser/service_worker/service_worker_test_utils.cc
      Line 284, Patchset 13 (Latest): commit_params->agent_cluster_key = blink::mojom::AgentClusterKey::New();
      Daniel Cheng . unresolved

      Should `blink::CreateCommitNavigationParams()` also just set this? Seems like it's not really optional anyway.

      (Though I guess it becomes messy if we make the agent cluster key a union as I suggested below–does the agent cluster key actually have three distinct states? Site, origin, and neither? Though based off the WebAgentClusterKey class... I'm not actually sure)

      File content/public/test/render_view_test.cc
      Line 758, Patchset 13 (Latest): commit_params->agent_cluster_key = blink::mojom::AgentClusterKey::New();
      Daniel Cheng . resolved

      And that would help with some of the boilerplate elsewhere I think

      File third_party/blink/public/mojom/frame/agent_cluster_key.mojom
      Line 10, Patchset 13 (Latest):// Indicates if cross-origin isolation gives access to cross-origin isolated
      Daniel Cheng . unresolved

      Nit: extra space

      Line 24, Patchset 13 (Latest): // when cross-origin sioaltion is enabled by COOP + COEP. When cross-origin
      Daniel Cheng . unresolved

      Nit: isolation.

      Line 42, Patchset 13 (Latest): // Additionally, the AgentClusterKey might have a CrossOriginIsolationKey is
      Daniel Cheng . unresolved

      if

      Line 37, Patchset 13 (Latest): // The AgentClusterKey has either a site URL or an origin. In the first case,
      // the AgentClusterKey is site keyed, in the second case, it is origin keyed.
      url.mojom.Url? url;
      url.mojom.Origin? origin;

      // Additionally, the AgentClusterKey might have a CrossOriginIsolationKey is
      // the context is cross-origin isolated. In this case, the AgentClusterKey
      // must be origin-keyed.
      // https://wicg.github.io/document-isolation-policy/#coi-agent-cluster-key
      CrossOriginIsolationKey? isolation_key;
      Daniel Cheng . unresolved

      It seems like maybe this should be a union consisting of either a `url.mojom.Url` or a `OriginKeyedAgentClusterKey` struct containing a `url.mojom.Origin` and a `CrossOriginIsolationKey` (not sure if the COI key is required in the case of origin-keyed origins)

      File third_party/blink/public/web/web_agent_cluster_key.h
      Line 40, Patchset 13 (Latest): std::optional<WebCrossOriginIsolationKey> isolation_key;
      Daniel Cheng . unresolved

      As noted above, can we restructure this so it's a variant of a WebURL and a struct containing a WebSecurityOrigin and an optional key?

      Line 23, Patchset 13 (Latest): mojom::CrossOriginIsolationMode cross_origin_isolation_mode)
      Camille Lamy . unresolved

      The presubmit checks complain about non-Blink mojom usage, but since this is the public interface that seems to be the correct thing to do to eventually translate into Blink mojom types. I'm not sure where I need to authorize this as I would have imagined that third_party/blink/public/web would not be covered by the check.

      Daniel Cheng

      I agree this is fine; can you link me to an example of the presubmit warning?

      File third_party/blink/renderer/core/execution_context/agent_cluster_key.h
      Line 33, Patchset 13 (Latest): AgentClusterKey();
      Daniel Cheng . unresolved

      What does this create by default? Is it site keyed, origin keyed, or neither?

      File third_party/blink/renderer/platform/weborigin/security_origin.h
      Line 414, Patchset 13 (Latest): // the custom HashTraits defined at the end of this file.
      Daniel Cheng . unresolved

      I don't think we should have both--or at the very least, one should delegate to the other.
      Can you file a TODO to clean this up? Is there a failing test someone can run when they are trying to figure out what's going wrong here?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Moshchuk
      • Camille Lamy
      Gerrit-Attention: Camille Lamy <cl...@chromium.org>
      Gerrit-Comment-Date: Mon, 27 Oct 2025 23:09:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Camille Lamy <cl...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Moshchuk (Gerrit)

      unread,
      Oct 31, 2025, 8:20:11 PMOct 31
      to Camille Lamy, Code Review Nudger, Daniel Cheng, AI Code Reviewer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Hiroki Nakagawa, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org
      Attention needed from Camille Lamy

      Alex Moshchuk added 11 comments

      Patchset-level comments
      Alex Moshchuk . resolved

      Thanks! I'll defer to Daniel on the blink changes; a few comments on the content side.

      File content/browser/agent_cluster_key.h
      Line 36, Patchset 13 (Latest):class CONTENT_EXPORT AgentClusterKey {
      Alex Moshchuk . unresolved

      I guess I'm a bit worried that we now have 3-4 places that define AgentClusterKeys (here, mojo, WebAgentClusterKey, and blink::AgentClusterKey), and they might get out of sync. Maybe it's intentional that the browser-side and renderer-side keys aren't going to be identical (e.g., the renderer doesn't need oac_status_), though we could at least add comments reminding what else must be updated when someone wants to add something to the AgentClusterKey? And maybe we could use LINT.IfChange to enforce that things stay updated together where it makes sense?

      Line 35, Patchset 13 (Latest):// SiteInfo, as it will only duplicate the information in AgentClusterKey.
      Alex Moshchuk . unresolved

      Might be worth updating this documentation to mention the other definitions of agent cluster key used in the renderer (and for sending this key to the renderer), and how they differ practically from this key.

      File content/browser/renderer_host/navigation_request.cc
      Line 4011, Patchset 13 (Latest): // Now build the appropriate AgentClusterKey for commit, starting with the
      Camille Lamy . unresolved

      I have been considering moving all the code below to SiteInfo, as it essentially undoes all the special cases of GetAgentClusterKeyForURL, so maybe having the two in the same place to compare would be nice.

      Alex Moshchuk

      Yes, it might be worth moving this code into a separate helper, and maybe SiteInfo is a better place for it, as this function is getting long. It might be worth keeping the focus of this function on the OAC stuff as before, and then computing the key_to_commit as a separate step.

      One high-level concern I have with the content/browser side of this CL is indeed about introducing another place for handling these special cases, and moreover trying to reconstruct how we computed a SiteInfo based on the AgentClusterKey after the fact, which seems fragile (and potentially hard to maintain for future changes to the process model). Do you think it could be better to compute both the agent cluster key for SiteInfo and the agent cluster key to send to the renderer in the same place in GetAgentClusterKeyForURL? Basically, have all the special cases in one place, but computing two keys? Or at least compute the should_update_origin_or_site bit there, so that we know that the site URL we ended up with in SiteInfo is a Chrome-process-model specific URL and not what the actual agent cluster key should be per spec.

      (I'm not sure this is better or even feasible, just curious if it's worth thinking about at all.)

      Line 4019, Patchset 13 (Latest): // isolation key. Currently, pages cross-origin isolated through COOP and COEP
      // are not given a cross-origin isolated AgentClusterKey. Override the
      Alex Moshchuk . unresolved

      It seems that this will be addressed by your https://chromium-review.googlesource.com/c/chromium/src/+/6516176? Will you be landing this CL before or after that?

      Line 4022, Patchset 13 (Latest): // the document already as a cross-origin isolated AgentClusterKey, which
      Alex Moshchuk . unresolved

      has

      Line 4122, Patchset 13 (Latest): origin.scheme())) {
      Alex Moshchuk . unresolved

      Is this to undo the case [here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/site_info.cc;l=791;drc=7ce25d3420a0eb77c46618536b3434f7b9ceef66)? Does it matter that this only applies to top-chrome WebUIs and not all WebUIs? Should it be more restricted to IsWebUIAndUsesTLDForProcessLockURL cases?

      Line 4129, Patchset 13 (Latest): should_update_origin_or_site = true;
      Alex Moshchuk . unresolved

      I guess we don't have this problem with features::kDefaultSiteInstanceGroups?

      Line 4134, Patchset 13 (Latest): // redirect causes the response URL to no longer match the original
      // SiteInstance. In that case, create a new AgentClusterKey.
      Alex Moshchuk . unresolved

      Is this actually intended behavior and not a bug? I think we try to disqualify the original SiteInstance in the NavigationEntry from being reused if it's no longer suitable for the redirected URL, with things like RenderFrameHostManager::CanUseDestinationInstance(). I'm surprised it would need its own condition here, as it seems like it might be violating our SiteInstance assignment rules.

      Line 4166, Patchset 13 (Latest): if (key_to_commit.IsSiteKeyed()) {
      Alex Moshchuk . unresolved

      Can there be some sort of conversion function to populate a mojo AgentClusterKey from a normal one, ideally in agent_cluster_key.*?

      File content/browser/renderer_host/render_process_host_impl.cc
      Line 3370, Patchset 13 (Latest): process_lock.agent_cluster_key().IsCrossOriginIsolated();
      Alex Moshchuk . unresolved

      Can this be cleaned up independently, or does it depend on something in this CL?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Camille Lamy
      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: Ibb98071005816e53e766fbcbe3fbcb642ee17592
      Gerrit-Change-Number: 7041044
      Gerrit-PatchSet: 13
      Gerrit-Owner: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Camille Lamy <cl...@chromium.org>
      Gerrit-Comment-Date: Sat, 01 Nov 2025 00:20:00 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Camille Lamy (Gerrit)

      unread,
      Nov 6, 2025, 11:23:46 AMNov 6
      to Code Review Nudger, Alex Moshchuk, Daniel Cheng, AI Code Reviewer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Hiroki Nakagawa, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org
      Attention needed from Alex Moshchuk and Daniel Cheng

      Camille Lamy voted and added 21 comments

      Votes added by Camille Lamy

      Commit-Queue+1

      21 comments

      Patchset-level comments
      File-level comment, Patchset 21 (Latest):
      Camille Lamy . resolved

      Thanks!

      File content/browser/agent_cluster_key.h
      Line 36, Patchset 13:class CONTENT_EXPORT AgentClusterKey {
      Alex Moshchuk . unresolved

      I guess I'm a bit worried that we now have 3-4 places that define AgentClusterKeys (here, mojo, WebAgentClusterKey, and blink::AgentClusterKey), and they might get out of sync. Maybe it's intentional that the browser-side and renderer-side keys aren't going to be identical (e.g., the renderer doesn't need oac_status_), though we could at least add comments reminding what else must be updated when someone wants to add something to the AgentClusterKey? And maybe we could use LINT.IfChange to enforce that things stay updated together where it makes sense?

      Camille Lamy

      I don't think we should pass the oac_status to the renderer process. I have added a LINT.IfChange comment (not sure of the usage, this is my first time using it).

      I agree that the duplication is unfortunate, but this is a side effect of the CommitNavigation not being sent to Blink directly. Otherwise, we could have had just the mojo struct, and used a typemap to map this struct to the Mojo struct.

      Line 35, Patchset 13:// SiteInfo, as it will only duplicate the information in AgentClusterKey.
      Alex Moshchuk . resolved

      Might be worth updating this documentation to mention the other definitions of agent cluster key used in the renderer (and for sending this key to the renderer), and how they differ practically from this key.

      Camille Lamy

      Done

      File content/browser/renderer_host/navigation_request.cc
      Line 4011, Patchset 13: // Now build the appropriate AgentClusterKey for commit, starting with the
      Camille Lamy . unresolved

      I have been considering moving all the code below to SiteInfo, as it essentially undoes all the special cases of GetAgentClusterKeyForURL, so maybe having the two in the same place to compare would be nice.

      Alex Moshchuk

      Yes, it might be worth moving this code into a separate helper, and maybe SiteInfo is a better place for it, as this function is getting long. It might be worth keeping the focus of this function on the OAC stuff as before, and then computing the key_to_commit as a separate step.

      One high-level concern I have with the content/browser side of this CL is indeed about introducing another place for handling these special cases, and moreover trying to reconstruct how we computed a SiteInfo based on the AgentClusterKey after the fact, which seems fragile (and potentially hard to maintain for future changes to the process model). Do you think it could be better to compute both the agent cluster key for SiteInfo and the agent cluster key to send to the renderer in the same place in GetAgentClusterKeyForURL? Basically, have all the special cases in one place, but computing two keys? Or at least compute the should_update_origin_or_site bit there, so that we know that the site URL we ended up with in SiteInfo is a Chrome-process-model specific URL and not what the actual agent cluster key should be per spec.

      (I'm not sure this is better or even feasible, just curious if it's worth thinking about at all.)

      Camille Lamy

      I have added a member to AgentClusterKey tracking whether we should update its origin/site URL before sending it. This allows to set it to true in all the edge cases we have in GetAgentClusterKeyForURL. This covers pretty much every edge case, except 4:

      • logical OAC (computed after we compute the AgentClusterKey)
      • opaque origins that are not data URLs -> we only pass the non opaque URL to SiteInfo, so it doesn't know the origin is actually opaque.
      • cross-origin isolated contexts when COI comes from COOP + COEP (temporary, will go away once we create AgentClusterKeys with COIKeys)
      • navigation to an existing SiteInstance without SiteIsolation when there is a redirect. See more about this one in the comment about this behavior.

      Wdyt of the new version?

      Line 4019, Patchset 13: // isolation key. Currently, pages cross-origin isolated through COOP and COEP

      // are not given a cross-origin isolated AgentClusterKey. Override the
      Alex Moshchuk . unresolved

      It seems that this will be addressed by your https://chromium-review.googlesource.com/c/chromium/src/+/6516176? Will you be landing this CL before or after that?

      Camille Lamy

      Yes the other CL will fix it, but I'd like to land this one first. This CL is needed for DIP on Android while the other isn't. And to land the other, I need to do more investigation on why the preparatory CLs failed, which I have pushed back until after I get DIP on Android.

      Line 4022, Patchset 13: // the document already as a cross-origin isolated AgentClusterKey, which
      Alex Moshchuk . resolved

      has

      Camille Lamy

      Done

      Line 4122, Patchset 13: origin.scheme())) {
      Alex Moshchuk . resolved

      Is this to undo the case [here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/site_info.cc;l=791;drc=7ce25d3420a0eb77c46618536b3434f7b9ceef66)? Does it matter that this only applies to top-chrome WebUIs and not all WebUIs? Should it be more restricted to IsWebUIAndUsesTLDForProcessLockURL cases?

      Camille Lamy

      Marked as resolved.

      Line 4129, Patchset 13: should_update_origin_or_site = true;
      Alex Moshchuk . resolved

      I guess we don't have this problem with features::kDefaultSiteInstanceGroups?

      Camille Lamy

      No kDefaultSiteInstanceGroups properly creates SiteInstances.

      Line 4134, Patchset 13: // redirect causes the response URL to no longer match the original

      // SiteInstance. In that case, create a new AgentClusterKey.
      Alex Moshchuk . unresolved

      Is this actually intended behavior and not a bug? I think we try to disqualify the original SiteInstance in the NavigationEntry from being reused if it's no longer suitable for the redirected URL, with things like RenderFrameHostManager::CanUseDestinationInstance(). I'm surprised it would need its own condition here, as it seems like it might be violating our SiteInstance assignment rules.

      Camille Lamy

      The test NavigationControllerBrowserTest.SiteInstanceChangeOnHistoryNavigation has expectations of the SiteInstance not changing when SiteIsolation is not enabled and the navigation to an existing SiteInstance encounters a cross-site reload.

      After further investigation, RenderFrameHostManager::CanUseDestinationInstance() will call SiteInstanceImpl::IsSuitableForUrlInfo. This in turns calls RenderProcessHostImpl::IsSuitableHost. In the non-Site Isolation case, the RPH is unlocked and the destination does not require a locked process, so the SiteInstance is deemed suitable and reused, even if the SiteInstance is not the default SiteInstance and its AgentClusterKey does not match the URL of the navigation.

      Line 4136, Patchset 13: bool is_navigation_to_existing_entry =
      Camille Lamy . resolved

      I still have one test failing for this specific case. I think it's a case of a subframe navigation to an existing subframe NavigationEntry. I'm not sure how to write the condition for it.

      Camille Lamy

      Done

      Line 4166, Patchset 13: if (key_to_commit.IsSiteKeyed()) {
      Alex Moshchuk . resolved

      Can there be some sort of conversion function to populate a mojo AgentClusterKey from a normal one, ideally in agent_cluster_key.*?

      Camille Lamy

      Done

      File content/browser/renderer_host/render_process_host_impl.cc
      Line 3370, Patchset 13: process_lock.agent_cluster_key().IsCrossOriginIsolated();
      Alex Moshchuk . unresolved

      Can this be cleaned up independently, or does it depend on something in this CL?

      Camille Lamy

      It could be done beforehand. Basically, I changed the CrossOriginIsolationMode enum to be a blink mojo enum, so the old code does not compile. I could just change the enum to the new version, but since we introduced the helper function in the meantime I thought it'd be cleaner to use the helper function.

      File content/browser/service_worker/service_worker_test_utils.cc
      Line 284, Patchset 13: commit_params->agent_cluster_key = blink::mojom::AgentClusterKey::New();
      Daniel Cheng . resolved

      Should `blink::CreateCommitNavigationParams()` also just set this? Seems like it's not really optional anyway.

      (Though I guess it becomes messy if we make the agent cluster key a union as I suggested below–does the agent cluster key actually have three distinct states? Site, origin, and neither? Though based off the WebAgentClusterKey class... I'm not actually sure)

      Camille Lamy

      Yes it makes sense to have blink::CreateCommitNavigationParams() create this. The AgentClusterKey has two states, site keyed or origin-keyed, now represented by a union. I think creating a default site keyed to GURL is fine, it can be replaced later down the road by the proper one.

      File third_party/blink/public/mojom/frame/agent_cluster_key.mojom
      Line 10, Patchset 13:// Indicates if cross-origin isolation gives access to cross-origin isolated
      Daniel Cheng . resolved

      Nit: extra space

      Camille Lamy

      Done

      Line 24, Patchset 13: // when cross-origin sioaltion is enabled by COOP + COEP. When cross-origin
      Daniel Cheng . resolved

      Nit: isolation.

      Camille Lamy

      Done

      Line 42, Patchset 13: // Additionally, the AgentClusterKey might have a CrossOriginIsolationKey is
      Daniel Cheng . resolved

      if

      Camille Lamy

      Done

      Line 37, Patchset 13: // The AgentClusterKey has either a site URL or an origin. In the first case,

      // the AgentClusterKey is site keyed, in the second case, it is origin keyed.
      url.mojom.Url? url;
      url.mojom.Origin? origin;

      // Additionally, the AgentClusterKey might have a CrossOriginIsolationKey is
      // the context is cross-origin isolated. In this case, the AgentClusterKey
      // must be origin-keyed.
      // https://wicg.github.io/document-isolation-policy/#coi-agent-cluster-key
      CrossOriginIsolationKey? isolation_key;
      Daniel Cheng . resolved

      It seems like maybe this should be a union consisting of either a `url.mojom.Url` or a `OriginKeyedAgentClusterKey` struct containing a `url.mojom.Origin` and a `CrossOriginIsolationKey` (not sure if the COI key is required in the case of origin-keyed origins)

      Camille Lamy

      Done

      File third_party/blink/public/web/web_agent_cluster_key.h
      Line 40, Patchset 13: std::optional<WebCrossOriginIsolationKey> isolation_key;
      Daniel Cheng . resolved

      As noted above, can we restructure this so it's a variant of a WebURL and a struct containing a WebSecurityOrigin and an optional key?

      Camille Lamy

      Done

      Line 23, Patchset 13: mojom::CrossOriginIsolationMode cross_origin_isolation_mode)
      Camille Lamy . resolved

      The presubmit checks complain about non-Blink mojom usage, but since this is the public interface that seems to be the correct thing to do to eventually translate into Blink mojom types. I'm not sure where I need to authorize this as I would have imagined that third_party/blink/public/web would not be covered by the check.

      Daniel Cheng

      I agree this is fine; can you link me to an example of the presubmit warning?

      Camille Lamy

      It seems it's no longer trigerring.

      File third_party/blink/renderer/core/execution_context/agent_cluster_key.h
      Line 33, Patchset 13: AgentClusterKey();
      Daniel Cheng . unresolved

      What does this create by default? Is it site keyed, origin keyed, or neither?

      Camille Lamy

      A site-keyed AgentClusterKey with KURL(). It's only there so that it works with the map. Added comments to clarify.

      File third_party/blink/renderer/platform/weborigin/security_origin.h
      Line 414, Patchset 13: // the custom HashTraits defined at the end of this file.
      Daniel Cheng . resolved

      I don't think we should have both--or at the very least, one should delegate to the other.
      Can you file a TODO to clean this up? Is there a failing test someone can run when they are trying to figure out what's going wrong here?

      Camille Lamy

      Removed this. Adding an import of third_party/blink/renderer/platform/weborigin/security_origin.h in the file using the HashTraits seems to have fixed the issue.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Moshchuk
      • Daniel Cheng
      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: Ibb98071005816e53e766fbcbe3fbcb642ee17592
      Gerrit-Change-Number: 7041044
      Gerrit-PatchSet: 21
      Gerrit-Owner: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Thu, 06 Nov 2025 16:23:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
      Comment-In-Reply-To: Camille Lamy <cl...@chromium.org>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Moshchuk (Gerrit)

      unread,
      Nov 12, 2025, 8:57:38 PM (10 days ago) Nov 12
      to Camille Lamy, Code Review Nudger, Daniel Cheng, AI Code Reviewer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Hiroki Nakagawa, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, gavinp...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org
      Attention needed from Camille Lamy and Daniel Cheng

      Alex Moshchuk added 18 comments

      Patchset-level comments
      Alex Moshchuk . resolved

      Thanks, and sorry it took a while to find enough focus time for this!

      File content/browser/agent_cluster_key.h
      Line 287, Patchset 21 (Latest): // manner. However, the proper origin or site URL of the navigation should
      Alex Moshchuk . unresolved

      Maybe give an example here, and mention that ideally this wouldn't be needed if we always created spec-compliant AgentClusterKeys and used SiteInstanceGroups to handle process allocation?

      Line 231, Patchset 21 (Latest): void set_update_key_before_sending(bool update_key_before_sending) {
      Alex Moshchuk . unresolved

      Do we need to pass a value, or can we assume it's always true? Seems like there'd be no use case for forcing this to be off.

      Line 231, Patchset 21 (Latest): void set_update_key_before_sending(bool update_key_before_sending) {
      Alex Moshchuk . unresolved

      It'd be nice if the name reflected something about this being for the renderer process, or that the renderer version of the key will differ. Some alternatives:

      • set_update_key_before_sending_to_renderer()
      • set_key_update_required_for_renderer() or set_should_update_key_for_renderer()
      • mark_for_renderer_key_correction() or set_needs_renderer_key_correction()
      • or maybe even set_key_is_not_spec_compliant() (maybe this isn't accurate though)
      Line 230, Patchset 21 (Latest): // before being sent to the renderer process.
      Alex Moshchuk . unresolved

      Mention how ideally all browser-side AgentClusterKeys would match those that we send to the renderer, but we have some cases where the browser-side AgentClusterKey will be set according to process allocation decisions, rather than what is required per spec, and we want to keep this transparent to the renderer and send it an idealized version of this key.

      Line 226, Patchset 21 (Latest): bool force_update,
      Alex Moshchuk . unresolved

      Let's also describe what this param is for in the comment. Also, is it needed? Could we get the same behavior by calling set_update_key_before_sending() on the key when this is true, before calling this function? (Or do we want to avoid modifying the key for these cases?)

      Line 36, Patchset 13:class CONTENT_EXPORT AgentClusterKey {
      Alex Moshchuk . resolved

      I guess I'm a bit worried that we now have 3-4 places that define AgentClusterKeys (here, mojo, WebAgentClusterKey, and blink::AgentClusterKey), and they might get out of sync. Maybe it's intentional that the browser-side and renderer-side keys aren't going to be identical (e.g., the renderer doesn't need oac_status_), though we could at least add comments reminding what else must be updated when someone wants to add something to the AgentClusterKey? And maybe we could use LINT.IfChange to enforce that things stay updated together where it makes sense?

      Camille Lamy

      I don't think we should pass the oac_status to the renderer process. I have added a LINT.IfChange comment (not sure of the usage, this is my first time using it).

      I agree that the duplication is unfortunate, but this is a side effect of the CommitNavigation not being sent to Blink directly. Otherwise, we could have had just the mojo struct, and used a typemap to map this struct to the Mojo struct.

      Alex Moshchuk

      Acknowledged

      File content/browser/agent_cluster_key.cc
      Line 159, Patchset 21 (Latest): const url::Origin& navigation_origin,
      Alex Moshchuk . unresolved

      origin_to_commit might be clearer?

      File content/browser/renderer_host/navigation_request.cc
      Line 4011, Patchset 13: // Now build the appropriate AgentClusterKey for commit, starting with the
      Camille Lamy . unresolved

      I have been considering moving all the code below to SiteInfo, as it essentially undoes all the special cases of GetAgentClusterKeyForURL, so maybe having the two in the same place to compare would be nice.

      Alex Moshchuk

      Yes, it might be worth moving this code into a separate helper, and maybe SiteInfo is a better place for it, as this function is getting long. It might be worth keeping the focus of this function on the OAC stuff as before, and then computing the key_to_commit as a separate step.

      One high-level concern I have with the content/browser side of this CL is indeed about introducing another place for handling these special cases, and moreover trying to reconstruct how we computed a SiteInfo based on the AgentClusterKey after the fact, which seems fragile (and potentially hard to maintain for future changes to the process model). Do you think it could be better to compute both the agent cluster key for SiteInfo and the agent cluster key to send to the renderer in the same place in GetAgentClusterKeyForURL? Basically, have all the special cases in one place, but computing two keys? Or at least compute the should_update_origin_or_site bit there, so that we know that the site URL we ended up with in SiteInfo is a Chrome-process-model specific URL and not what the actual agent cluster key should be per spec.

      (I'm not sure this is better or even feasible, just curious if it's worth thinking about at all.)

      Camille Lamy

      I have added a member to AgentClusterKey tracking whether we should update its origin/site URL before sending it. This allows to set it to true in all the edge cases we have in GetAgentClusterKeyForURL. This covers pretty much every edge case, except 4:

      • logical OAC (computed after we compute the AgentClusterKey)
      • opaque origins that are not data URLs -> we only pass the non opaque URL to SiteInfo, so it doesn't know the origin is actually opaque.
      • cross-origin isolated contexts when COI comes from COOP + COEP (temporary, will go away once we create AgentClusterKeys with COIKeys)
      • navigation to an existing SiteInstance without SiteIsolation when there is a redirect. See more about this one in the comment about this behavior.

      Wdyt of the new version?

      Alex Moshchuk

      Thanks, this looks better to me. It's a bit unfortunate that these decisions are still pretty spread out (e.g., the four exception cases you mentioned are here, most cases are special-cased in GetAgentClusterKeyForURL(), some are in special-case SiteInfo constructors (e.g. CreateForErrorPage), and then the last redirect case is in an entirely different place. I don't know if there's fundamentally a better organization, though, given all the constraints and how everything is structured at the moment. E.g., computing the renderer-side key closer to the place where we compute the browser-side key may not be possible without additional context for some cases (e.g., the data URL or the redirect cases you mentioned).

      I do have a couple of questions:

      • One SiteInstance might get reused by several possibly concurrent navigations (e.g., in several subframes). Is it a problem that we might set the new flag for one navigation and then a different navigation for different URL/origin might look at it at commit time, and incorrectly rely on the value of that flag that was computed for a different navigation? Or do we expect that all navigations in a particular SiteInstance that's marked as having a non-compliant key will need to recompute the AgentClusterKey?
      • Could we actually compute the renderer key from scratch at commit time, instead of basing it off of the browser-side key? We already have the origin to commit and at least some of the inputs for when it needs to be origin-keyed and/or cross-origin-isolated. Could that be simpler than trying to decide what pieces of the browser-side key can be reused?
      Line 4019, Patchset 13: // isolation key. Currently, pages cross-origin isolated through COOP and COEP
      // are not given a cross-origin isolated AgentClusterKey. Override the
      Alex Moshchuk . resolved

      It seems that this will be addressed by your https://chromium-review.googlesource.com/c/chromium/src/+/6516176? Will you be landing this CL before or after that?

      Camille Lamy

      Yes the other CL will fix it, but I'd like to land this one first. This CL is needed for DIP on Android while the other isn't. And to land the other, I need to do more investigation on why the preparatory CLs failed, which I have pushed back until after I get DIP on Android.

      Alex Moshchuk

      Acknowledged

      Line 4134, Patchset 13: // redirect causes the response URL to no longer match the original
      // SiteInstance. In that case, create a new AgentClusterKey.
      Alex Moshchuk . unresolved

      Is this actually intended behavior and not a bug? I think we try to disqualify the original SiteInstance in the NavigationEntry from being reused if it's no longer suitable for the redirected URL, with things like RenderFrameHostManager::CanUseDestinationInstance(). I'm surprised it would need its own condition here, as it seems like it might be violating our SiteInstance assignment rules.

      Camille Lamy

      The test NavigationControllerBrowserTest.SiteInstanceChangeOnHistoryNavigation has expectations of the SiteInstance not changing when SiteIsolation is not enabled and the navigation to an existing SiteInstance encounters a cross-site reload.

      After further investigation, RenderFrameHostManager::CanUseDestinationInstance() will call SiteInstanceImpl::IsSuitableForUrlInfo. This in turns calls RenderProcessHostImpl::IsSuitableHost. In the non-Site Isolation case, the RPH is unlocked and the destination does not require a locked process, so the SiteInstance is deemed suitable and reused, even if the SiteInstance is not the default SiteInstance and its AgentClusterKey does not match the URL of the navigation.

      Alex Moshchuk

      Thanks, that helps. When site isolation is not enabled, I wonder if this case should instead create a new SiteInstance (with a SiteInfo that reflects the post-redirect URL) in the same SiteInstanceGroup, instead of staying in the old SiteInstance? Would doing that fix this issue, at least when we're using DefaultSiteInstanceGroups (which should be everywhere except Android Webview at this point)? The point of DefaultSiteInstanceGroups is to keep meaningful site URLs in cases like this, which this test case seems to violate, so might be worth filing this as a separate bug in DefaultSiteInstanceGroups.

      File content/browser/renderer_host/render_frame_host_manager.cc
      Line 3452, Patchset 21 (Latest): url::Origin origin = url::Origin::Create(dest_url_info.url);
      Alex Moshchuk . unresolved

      Hmm, this seems like it might not be correct in corner cases like sandboxed frames or about:blank or error pages, or cases where dest_url_info.origin is set. I'm not sure exactly how to fix it, but it feels it should use NavigationRequest::GetOriginToCommit() (or GetTentativeOriginAtRequestTime() if this is called prior to ready-to-commit), which is what we use later to pass to GetAgentClusterKeyForNavigationCommit().

      File content/browser/renderer_host/render_process_host_impl.cc
      Line 3370, Patchset 13: process_lock.agent_cluster_key().IsCrossOriginIsolated();
      Alex Moshchuk . resolved

      Can this be cleaned up independently, or does it depend on something in this CL?

      Camille Lamy

      It could be done beforehand. Basically, I changed the CrossOriginIsolationMode enum to be a blink mojo enum, so the old code does not compile. I could just change the enum to the new version, but since we introduced the helper function in the meantime I thought it'd be cleaner to use the helper function.

      Alex Moshchuk

      Acknowledged

      File content/browser/site_info.h
      Line 413, Patchset 21 (Latest): // origin or URL of the AgentClusterKey.
      Alex Moshchuk . unresolved

      Nit: these and similar comments might benefit from a simple concrete example of where they differ (e.g., special-case site URLs like chrome-error or data:nonce). (I know there'll be some duplication and that you do have examples elsewhere...)

      File content/browser/site_info.cc
      Line 162, Patchset 21 (Latest): /*update_key_before_sending=*/true);
      Alex Moshchuk . unresolved

      This probably needs a quick comment to explain that error pages commit in chrome-error:// SiteInstances, which is Chrome's process model behavior that shouldn't be reflected in the key exposed to the renderer.

      Actually, what is the renderer-side AgentClusterKey for error pages? Is it based on an opaque origin?

      Line 205, Patchset 21 (Latest): /*update_key_before_sending=*/true);
      Alex Moshchuk . unresolved

      This probably needs a comment to explain why default SiteInstances set this to true (because by definition their Site URL will be shared among potentially multiple cross-site documents and won't match a particular navigation's site.)

      Line 210, Patchset 21 (Latest): /*update_key_before_sending=*/true);
      Alex Moshchuk . unresolved

      I'm on the fence about passing this new arg when creating every new AgentClusterKey. It seems the cases where we have to set this to true should gradually disappear as we roll out more uses of SiteInstanceGroups, right?

      While requiring it as an explicit param is useful to force all callers to reason about it, I also think that we shouldn't add new exceptions going forward, and that all new code should use SiteInstanceGroups rather than add an exception that forces this update. So, maybe we can rely on a separate call to set_update_key_before_sending() for setting this flag, on newly created AgentClusterKeys that need this? That would also provide a more convenient place to add a comment to explain why each particular use case needs this set, and would also make it easier to identify all places that we'd want to eventually update to use SiteInstanceGroups.

      If we wanted to keep call sites that return a create key right away, we could also consider making the function that sets this flag internally also return the key it just modified, or creating alternate versions of the constructors, e.g. CreateNonSpecCompliantSiteKeyed().

      Line 977, Patchset 21 (Latest): true);
      Alex Moshchuk . unresolved

      Why does this need to update the key? Is it because we're creating a site-keyed key but the site URL might not actually be a site but rather an (isolated) origin? Let's explain in a comment if so.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Camille Lamy
      • Daniel Cheng
      Gerrit-Attention: Camille Lamy <cl...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Thu, 13 Nov 2025 01:57:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages