[PWA][3/N] Extensions commit launch params post navigation commit [chromium/src : main]

0 views
Skip to first unread message

Dibyajyoti Pal (Gerrit)

unread,
May 26, 2026, 7:20:57 PM (2 days ago) May 26
to Finnur Thorarinsson, Daniel Murphy, Chromium Web Applications Reviews, Chromium LUCI CQ, chromium...@chromium.org, aixba+wat...@chromium.org, chromium-a...@chromium.org, cros-essential...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, japhet+...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Chromium Web Applications Reviews, Daniel Murphy and Finnur Thorarinsson

Dibyajyoti Pal added 1 comment

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Dibyajyoti Pal . resolved

PTAL, thanks!

+finnur@ for `c/b/extensions`
+dmurph@ for the rest of the code.

Open in Gerrit

Related details

Attention is currently required from:
  • Chromium Web Applications Reviews
  • Daniel Murphy
  • Finnur Thorarinsson
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: Ibbd9f966728b10382a78ab632d33e734923802fa
Gerrit-Change-Number: 7870121
Gerrit-PatchSet: 11
Gerrit-Owner: Dibyajyoti Pal <diby...@chromium.org>
Gerrit-Reviewer: Chromium Web Applications Reviews <chromium-web...@google.com>
Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
Gerrit-Reviewer: Finnur Thorarinsson <fin...@chromium.org>
Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
Gerrit-Attention: Chromium Web Applications Reviews <chromium-web...@google.com>
Gerrit-Attention: Finnur Thorarinsson <fin...@chromium.org>
Gerrit-Comment-Date: Tue, 26 May 2026 23:20:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Finnur Thorarinsson (Gerrit)

unread,
May 27, 2026, 4:44:17 AM (yesterday) May 27
to Dibyajyoti Pal, Daniel Murphy, Chromium LUCI CQ, chromium...@chromium.org, aixba+wat...@chromium.org, chromium-a...@chromium.org, cros-essential...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, japhet+...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Daniel Murphy and Dibyajyoti Pal

Finnur Thorarinsson voted and added 1 comment

Votes added by Finnur Thorarinsson

Code-Review+1

1 comment

Patchset-level comments
Finnur Thorarinsson . resolved

*/extensions/* LGTM

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Murphy
  • Dibyajyoti Pal
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: Ibbd9f966728b10382a78ab632d33e734923802fa
    Gerrit-Change-Number: 7870121
    Gerrit-PatchSet: 11
    Gerrit-Owner: Dibyajyoti Pal <diby...@chromium.org>
    Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
    Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
    Gerrit-Reviewer: Finnur Thorarinsson <fin...@chromium.org>
    Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
    Gerrit-Attention: Dibyajyoti Pal <diby...@chromium.org>
    Gerrit-Comment-Date: Wed, 27 May 2026 08:44:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Murphy (Gerrit)

    unread,
    3:39 PM (1 hour ago) 3:39 PM
    to Dibyajyoti Pal, Finnur Thorarinsson, Daniel Murphy, Chromium LUCI CQ, chromium...@chromium.org, aixba+wat...@chromium.org, chromium-a...@chromium.org, cros-essential...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, japhet+...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Dibyajyoti Pal

    Daniel Murphy added 1 comment

    File chrome/browser/web_applications/web_app_tab_helper.h
    Line 161, Patchset 14: const std::optional<webapps::AppId>& pending_launch_app_id() const {
    Daniel Murphy . unresolved

    Suggested Architecture Improvement:

    Instead of storing a single `pending_launch_app_id_` on `WebAppTabHelper` (which is prone to race conditions if launches overlap), we should track the active launch navigation using a `base::WeakPtr` to `WebAppLaunchNavigationHandleUserData`.

    **Proof of Single Navigation Handle**:
    As confirmed in `content/browser/renderer_host/frame_tree_node.h`, a `FrameTreeNode` owns at most one active `NavigationRequest` (which implements `NavigationHandle`) for the frame:
    `std::unique_ptr<NavigationRequest> navigation_request_;`
    Starting a new navigation cancels the previous one (see `FrameTreeNode::ResetNavigationRequest`). Thus, for the top-level frame (which app launches target), there is at most one active navigation handle at a time.

    **Proposed Design**:
    1. `WebAppLaunchNavigationHandleUserData` implements a `WeakPtrFactory`.
    2. On `SetLaunchParams`, it registers its `WeakPtr` with `WebAppTabHelper`: `tab_helper->SetPendingLaunch(GetWeakPtr())`.
    3. `WebAppTabHelper` stores: `base::WeakPtr<WebAppLaunchNavigationHandleUserData> pending_launch_;`.
    4. `WebAppLaunchProcess::MaybeNavigateBrowser` checks `tab_helper->GetPendingLaunchForApp(app_id)`.
    5. If found, it replaces the old params with the new one (that's the design we want, right?)
    6. On commit, the user data dispatches the params to the simplified `LaunchQueue`.
    7. On destruction of the navigation handle, `pending_launch_` automatically becomes null.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dibyajyoti Pal
    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: Ibbd9f966728b10382a78ab632d33e734923802fa
      Gerrit-Change-Number: 7870121
      Gerrit-PatchSet: 14
      Gerrit-Owner: Dibyajyoti Pal <diby...@chromium.org>
      Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
      Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
      Gerrit-Reviewer: Finnur Thorarinsson <fin...@chromium.org>
      Gerrit-Attention: Dibyajyoti Pal <diby...@chromium.org>
      Gerrit-Comment-Date: Thu, 28 May 2026 19:38:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dibyajyoti Pal (Gerrit)

      unread,
      4:28 PM (1 hour ago) 4:28 PM
      to Finnur Thorarinsson, Daniel Murphy, Chromium LUCI CQ, chromium...@chromium.org, aixba+wat...@chromium.org, chromium-a...@chromium.org, cros-essential...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, japhet+...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
      Attention needed from Daniel Murphy and Finnur Thorarinsson

      Dibyajyoti Pal added 1 comment

      File chrome/browser/web_applications/web_app_tab_helper.h
      Line 161, Patchset 14: const std::optional<webapps::AppId>& pending_launch_app_id() const {
      Daniel Murphy . unresolved

      Suggested Architecture Improvement:

      Instead of storing a single `pending_launch_app_id_` on `WebAppTabHelper` (which is prone to race conditions if launches overlap), we should track the active launch navigation using a `base::WeakPtr` to `WebAppLaunchNavigationHandleUserData`.

      **Proof of Single Navigation Handle**:
      As confirmed in `content/browser/renderer_host/frame_tree_node.h`, a `FrameTreeNode` owns at most one active `NavigationRequest` (which implements `NavigationHandle`) for the frame:
      `std::unique_ptr<NavigationRequest> navigation_request_;`
      Starting a new navigation cancels the previous one (see `FrameTreeNode::ResetNavigationRequest`). Thus, for the top-level frame (which app launches target), there is at most one active navigation handle at a time.

      **Proposed Design**:
      1. `WebAppLaunchNavigationHandleUserData` implements a `WeakPtrFactory`.
      2. On `SetLaunchParams`, it registers its `WeakPtr` with `WebAppTabHelper`: `tab_helper->SetPendingLaunch(GetWeakPtr())`.
      3. `WebAppTabHelper` stores: `base::WeakPtr<WebAppLaunchNavigationHandleUserData> pending_launch_;`.
      4. `WebAppLaunchProcess::MaybeNavigateBrowser` checks `tab_helper->GetPendingLaunchForApp(app_id)`.
      5. If found, it replaces the old params with the new one (that's the design we want, right?)
      6. On commit, the user data dispatches the params to the simplified `LaunchQueue`.
      7. On destruction of the navigation handle, `pending_launch_` automatically becomes null.

      Dibyajyoti Pal

      Oooo using the navigation handle to track the pending app_id for navigation, love that idea! Implemented.

      The only issue is that the `WebAppLaunchNavigationHandleUserData` lies in `c/b/ui/`, so we can't include it directly inside `c/b/web_applications/`, so I worked around it by creating a pure virtual `WebAppLaunchParamsHolder` class inside `c/b/web_applications/` that `WebAppLaunchNavigationHandleUserData` implements. This seems to work, PTAL and let me know if there is perhaps a simpler way to do it.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Murphy
      • Finnur Thorarinsson
      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: Ibbd9f966728b10382a78ab632d33e734923802fa
        Gerrit-Change-Number: 7870121
        Gerrit-PatchSet: 16
        Gerrit-Owner: Dibyajyoti Pal <diby...@chromium.org>
        Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
        Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
        Gerrit-Reviewer: Finnur Thorarinsson <fin...@chromium.org>
        Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
        Gerrit-Attention: Finnur Thorarinsson <fin...@chromium.org>
        Gerrit-Comment-Date: Thu, 28 May 2026 20:28:21 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Daniel Murphy <dmu...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Dibyajyoti Pal (Gerrit)

        unread,
        4:29 PM (30 minutes ago) 4:29 PM
        to Finnur Thorarinsson, Daniel Murphy, Chromium LUCI CQ, chromium...@chromium.org, aixba+wat...@chromium.org, chromium-a...@chromium.org, cros-essential...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, feature-me...@chromium.org, japhet+...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mek+w...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
        Attention needed from Daniel Murphy and Finnur Thorarinsson

        Dibyajyoti Pal added 1 comment

        Patchset-level comments
        Finnur Thorarinsson . resolved

        */extensions/* LGTM

        Dibyajyoti Pal

        PTAL, I made an architectural change that uploaded new files from before, and wiped out the +1s. The extensions changes are still the same, can you PTAL again? Thanks!

        Gerrit-Comment-Date: Thu, 28 May 2026 20:29:08 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Finnur Thorarinsson <fin...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages