[prerender] Allow prerendering pages to reuse initiator's process [chromium/src : main]

0 views
Skip to first unread message

Lingqi Chi (Gerrit)

unread,
Jun 17, 2026, 5:40:31 AM (12 days ago) Jun 17
to Hiroki Nakagawa, Taiyo Mizuhashi, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, gavin...@chromium.org, tburkar...@chromium.org
Attention needed from Hiroki Nakagawa and Taiyo Mizuhashi

Lingqi Chi voted and added 1 comment

Votes added by Lingqi Chi

Commit-Queue+0

1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Lingqi Chi . resolved

PTAL 😊

Open in Gerrit

Related details

Attention is currently required from:
  • Hiroki Nakagawa
  • Taiyo Mizuhashi
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I594986c53d56f7c7320621406a5ad8332190e6e0
Gerrit-Change-Number: 7950197
Gerrit-PatchSet: 5
Gerrit-Owner: Lingqi Chi <lin...@chromium.org>
Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Reviewer: Lingqi Chi <lin...@chromium.org>
Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Jun 2026 09:39:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Hiroki Nakagawa (Gerrit)

unread,
Jun 18, 2026, 1:04:07 AM (12 days ago) Jun 18
to Lingqi Chi, Taiyo Mizuhashi, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, gavin...@chromium.org, tburkar...@chromium.org
Attention needed from Lingqi Chi and Taiyo Mizuhashi

Hiroki Nakagawa voted and added 5 comments

Votes added by Hiroki Nakagawa

Code-Review+1

5 comments

Patchset-level comments
Hiroki Nakagawa . resolved

LGTM, thanks!

File content/browser/preloading/prerender/prerender_browsertest.cc
Line 19037, Patchset 5 (Latest): SameSitePrerenderReusesProcess) {
Hiroki Nakagawa . unresolved

Actually this test confirms the `same-origin` case. Can we also confirm the same-site cross-origin case?

Line 19087, Patchset 5 (Latest): // Use PrerenderHostRegistry to cancel.
Hiroki Nakagawa . unresolved

This comment may not be useful?

File content/browser/preloading/prerender/prerender_host.cc
Line 518, Patchset 5 (Latest): scoped_refptr<SiteInstanceImpl> site_instance;
Hiroki Nakagawa . unresolved

Do we need to split initialization from declaration? Can we keep the original structure?

```
scoped_refptr<SiteInstanceImpl> site_instance =
base::FeatureList::IsEnabled(kCreatePrerenderSiteInstanceWithURL)
? SiteInstanceImpl::CreateForURL(web_contents.GetBrowserContext(),
attributes.prerendering_url)
: SiteInstanceImpl::Create(web_contents.GetBrowserContext());
```
Line 519, Patchset 5 (Latest):
// TODO(https://crbug.com/524800804): Add the following restrictions:
// 1. Limit to prerender-until-script for now.
// 2. For moderate eagerness only
// 3. Disallow Target_hint = 'blank' to use the same process.
// 4. Disallow cross-site prerendering to reuse the process.
Hiroki Nakagawa . unresolved

These comments should be placed on the following if-condition, not on the initialization of `site_instance`?

```
// TODO(https://crbug.com/524800804): Add the following restrictions:
// 1. Limit to prerender-until-script for now.
// 2. For moderate eagerness only
// 3. Disallow Target_hint = 'blank' to use the same process.
// 4. Disallow cross-site prerendering to reuse the process.
if (!attributes.IsBrowserInitiated() &&
attributes.initiator_frame_token.has_value() &&
base::FeatureList::IsEnabled(
features::kPrerender2ReuseInitiatorProcess)) {
RenderFrameHostImpl* initiator_rfh = RenderFrameHostImpl::FromFrameToken(
attributes.initiator_process_id,
attributes.initiator_frame_token.value());
if (initiator_rfh) {
site_instance->ReuseExistingProcessIfPossible(
initiator_rfh->GetProcess());
}
}
```
Open in Gerrit

Related details

Attention is currently required from:
  • Lingqi Chi
  • Taiyo Mizuhashi
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: I594986c53d56f7c7320621406a5ad8332190e6e0
    Gerrit-Change-Number: 7950197
    Gerrit-PatchSet: 5
    Gerrit-Owner: Lingqi Chi <lin...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Lingqi Chi <lin...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Attention: Lingqi Chi <lin...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Jun 2026 05:03:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lingqi Chi (Gerrit)

    unread,
    Jun 18, 2026, 1:16:16 AM (12 days ago) Jun 18
    to Hiroki Nakagawa, Taiyo Mizuhashi, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, gavin...@chromium.org, tburkar...@chromium.org
    Attention needed from Taiyo Mizuhashi

    Lingqi Chi voted and added 5 comments

    Votes added by Lingqi Chi

    Commit-Queue+1

    5 comments

    Patchset-level comments
    File-level comment, Patchset 5:
    Lingqi Chi . resolved

    thanks!

    File content/browser/preloading/prerender/prerender_browsertest.cc
    Line 19037, Patchset 5: SameSitePrerenderReusesProcess) {
    Hiroki Nakagawa . resolved

    Actually this test confirms the `same-origin` case. Can we also confirm the same-site cross-origin case?

    Lingqi Chi

    oh indeed.. thinking of that, let me start with same-origin prerendering to minimize the security concern.

    Line 19087, Patchset 5: // Use PrerenderHostRegistry to cancel.
    Hiroki Nakagawa . resolved

    This comment may not be useful?

    Lingqi Chi

    Done

    File content/browser/preloading/prerender/prerender_host.cc
    Line 518, Patchset 5: scoped_refptr<SiteInstanceImpl> site_instance;
    Hiroki Nakagawa . resolved

    Do we need to split initialization from declaration? Can we keep the original structure?

    ```
    scoped_refptr<SiteInstanceImpl> site_instance =
    base::FeatureList::IsEnabled(kCreatePrerenderSiteInstanceWithURL)
    ? SiteInstanceImpl::CreateForURL(web_contents.GetBrowserContext(),
    attributes.prerendering_url)
    : SiteInstanceImpl::Create(web_contents.GetBrowserContext());
    ```
    Lingqi Chi

    Done.


    // TODO(https://crbug.com/524800804): Add the following restrictions:
    // 1. Limit to prerender-until-script for now.
    // 2. For moderate eagerness only
    // 3. Disallow Target_hint = 'blank' to use the same process.
    // 4. Disallow cross-site prerendering to reuse the process.
    Hiroki Nakagawa . resolved

    These comments should be placed on the following if-condition, not on the initialization of `site_instance`?

    ```
    // TODO(https://crbug.com/524800804): Add the following restrictions:
    // 1. Limit to prerender-until-script for now.
    // 2. For moderate eagerness only
    // 3. Disallow Target_hint = 'blank' to use the same process.
    // 4. Disallow cross-site prerendering to reuse the process.
    if (!attributes.IsBrowserInitiated() &&
    attributes.initiator_frame_token.has_value() &&
    base::FeatureList::IsEnabled(
    features::kPrerender2ReuseInitiatorProcess)) {
    RenderFrameHostImpl* initiator_rfh = RenderFrameHostImpl::FromFrameToken(
    attributes.initiator_process_id,
    attributes.initiator_frame_token.value());
    if (initiator_rfh) {
    site_instance->ReuseExistingProcessIfPossible(
    initiator_rfh->GetProcess());
    }
    }
    ```
    Lingqi Chi

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Taiyo Mizuhashi
    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: I594986c53d56f7c7320621406a5ad8332190e6e0
      Gerrit-Change-Number: 7950197
      Gerrit-PatchSet: 6
      Gerrit-Owner: Lingqi Chi <lin...@chromium.org>
      Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Reviewer: Lingqi Chi <lin...@chromium.org>
      Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
      Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-Comment-Date: Thu, 18 Jun 2026 05:15:37 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Hiroki Nakagawa <nhi...@chromium.org>
      satisfied_requirement
      open
      diffy

      Lingqi Chi (Gerrit)

      unread,
      Jun 18, 2026, 9:39:03 PM (11 days ago) Jun 18
      to Hiroki Nakagawa, Taiyo Mizuhashi, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, gavin...@chromium.org, tburkar...@chromium.org
      Attention needed from Taiyo Mizuhashi

      Lingqi Chi voted and added 1 comment

      Votes added by Lingqi Chi

      Commit-Queue+2

      1 comment

      Patchset-level comments
      File-level comment, Patchset 7 (Latest):
      Lingqi Chi . resolved

      let me submit this cl for now. Taiyo-san, plmk if you have any concerns.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Taiyo Mizuhashi
      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: I594986c53d56f7c7320621406a5ad8332190e6e0
      Gerrit-Change-Number: 7950197
      Gerrit-PatchSet: 7
      Gerrit-Owner: Lingqi Chi <lin...@chromium.org>
      Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Reviewer: Lingqi Chi <lin...@chromium.org>
      Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
      Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-Comment-Date: Fri, 19 Jun 2026 01:38:37 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Jun 18, 2026, 9:42:27 PM (11 days ago) Jun 18
      to Lingqi Chi, Hiroki Nakagawa, Taiyo Mizuhashi, chromium...@chromium.org, prerendering-reviews, gavin...@chromium.org, tburkar...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      5 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: content/browser/preloading/prerender/prerender_browsertest.cc
      Insertions: 6, Deletions: 5.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: content/browser/preloading/prerender/prerender_host.cc
      Insertions: 5, Deletions: 7.

      The diff is too large to show. Please review the diff.
      ```

      Change information

      Commit message:
      [prerender] Allow prerendering pages to reuse initiator's process

      This CL adds the basic implementation to allow prerendering pages to
      reuse the initiator page's renderer process, for saving resources and
      speeding up prerendering pages.

      The implementation is behind a feature flag.
      And follow-up CLs will restrict this feature to be used for same-site
      pus pages only.
      Bug: 524800804
      Change-Id: I594986c53d56f7c7320621406a5ad8332190e6e0
      Commit-Queue: Lingqi Chi <lin...@chromium.org>
      Reviewed-by: Hiroki Nakagawa <nhi...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1649452}
      Files:
      • M content/browser/preloading/prerender/prerender_browsertest.cc
      • M content/browser/preloading/prerender/prerender_features.cc
      • M content/browser/preloading/prerender/prerender_features.h
      • M content/browser/preloading/prerender/prerender_host.cc
      Change size: M
      Delta: 4 files changed, 113 insertions(+), 0 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Hiroki Nakagawa
      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: I594986c53d56f7c7320621406a5ad8332190e6e0
      Gerrit-Change-Number: 7950197
      Gerrit-PatchSet: 8
      Gerrit-Owner: Lingqi Chi <lin...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Reviewer: Lingqi Chi <lin...@chromium.org>
      Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages