[WIP] OMTPrefetch: Introduce PrePrefetchContainer [chromium/src : main]

0 views
Skip to first unread message

Taiyo Mizuhashi (Gerrit)

unread,
Feb 26, 2026, 11:26:03 AMFeb 26
to AyeAye, Hiroshige Hayashizaki, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
Attention needed from Hiroshige Hayashizaki

Taiyo Mizuhashi added 2 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Taiyo Mizuhashi . resolved

Early return. I think this will be reviewable assuming "PrefetchContainer is created on a specific sequence", once test flakiness is resolved

File content/browser/preloading/prefetch/pre_prefetch_container.cc
Line 77, Patchset 6: resource_request_ = CreateResourceRequestForNavigation(
Hiroshige Hayashizaki . resolved

Add a comment to `CreateResourceRequestForNavigation()` that `CreateResourceRequestForNavigation()` can be called from non-UI thread for preprefetch.

Taiyo Mizuhashi

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Hiroshige Hayashizaki
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: I599e705d5b90064768a524c1e313ad147fa3cdab
Gerrit-Change-Number: 7559092
Gerrit-PatchSet: 9
Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
Gerrit-Comment-Date: Thu, 26 Feb 2026 16:25:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Taiyo Mizuhashi (Gerrit)

unread,
Mar 3, 2026, 3:24:29 PM (9 days ago) Mar 3
to Hiroki Nakagawa, Ken Okada, Kouhei Ueno, AyeAye, Hiroshige Hayashizaki, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
Attention needed from Hiroki Nakagawa and Ken Okada

Taiyo Mizuhashi added 1 comment

Patchset-level comments
File-level comment, Patchset 15 (Latest):
Taiyo Mizuhashi . resolved

Although crrev.com/c/7544249 is not fully ready (sorry), I would like to start this review because I think is reviewable assuming "PrefetchContainer is created on a specific sequence (which will be ensured by `PrePrefetchService`, and necessary object (PrefetchRequest, URLLoaderFactory, etc is appropriately provided by them",

PTAL, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Hiroki Nakagawa
  • Ken Okada
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: I599e705d5b90064768a524c1e313ad147fa3cdab
Gerrit-Change-Number: 7559092
Gerrit-PatchSet: 15
Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
Gerrit-CC: Kouhei Ueno <kou...@chromium.org>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Attention: Ken Okada <ken...@chromium.org>
Gerrit-Comment-Date: Tue, 03 Mar 2026 20:24:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ken Okada (Gerrit)

unread,
Mar 4, 2026, 6:46:06 PM (8 days ago) Mar 4
to Taiyo Mizuhashi, Hiroki Nakagawa, Kouhei Ueno, AyeAye, Hiroshige Hayashizaki, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
Attention needed from Hiroki Nakagawa, Hiroshige Hayashizaki and Taiyo Mizuhashi

Ken Okada added 7 comments

Commit Message
Line 9, Patchset 16 (Latest):This CL introduces a class `PrePrefetchContainer` that represents a
Ken Okada . unresolved

an

File content/browser/loader/navigation_url_loader_impl.h
Line 617, Patchset 16 (Latest):// details).
Ken Okada . unresolved

s/details/details./

File content/browser/preloading/prefetch/pre_prefetch_container.h
Line 30, Patchset 16 (Latest):// - This is always created from static function `CreateAndStart()`, which
Ken Okada . unresolved

via?

File content/browser/preloading/prefetch/pre_prefetch_container.cc
Line 45, Patchset 16 (Latest): return container;
Ken Okada . unresolved

`return std::move(container)` (Or, it is using NVRO?)

Line 54, Patchset 16 (Latest): DCHECK(!BrowserThread::CurrentlyOn(content::BrowserThread::UI));
Ken Okada . unresolved

Why `DCEHCK`? I believe that it should be `CHECK`.

Line 80, Patchset 16 (Latest): net::IsolationInfo::RequestType::kMainFrame, origin, origin,
Ken Okada . unresolved

Could you add comment `/*arg=*/`?

Line 86, Patchset 16 (Latest): /*devtools_observer=*/mojo::NullRemote(), net::RequestPriority::HIGHEST,
Ken Okada . unresolved

Could you add a comment why we use HIGHEST here, while ordinal prefetch uses `PrefetchPriority`. (Or, we'll loose the context in the futurue.)

Open in Gerrit

Related details

Attention is currently required from:
  • Hiroki Nakagawa
  • Hiroshige Hayashizaki
  • Taiyo Mizuhashi
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: I599e705d5b90064768a524c1e313ad147fa3cdab
    Gerrit-Change-Number: 7559092
    Gerrit-PatchSet: 16
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Kouhei Ueno <kou...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 23:45:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroshige Hayashizaki (Gerrit)

    unread,
    Mar 5, 2026, 6:21:07 PM (7 days ago) Mar 5
    to Taiyo Mizuhashi, Hiroki Nakagawa, Ken Okada, Kouhei Ueno, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
    Attention needed from Hiroki Nakagawa and Taiyo Mizuhashi

    Hiroshige Hayashizaki added 3 comments

    File content/browser/preloading/prefetch/pre_prefetch_container.h
    Line 38, Patchset 17 (Latest):class CONTENT_EXPORT PrePrefetchContainer {
    Hiroshige Hayashizaki . unresolved

    nit: final

    File content/browser/preloading/prefetch/pre_prefetch_container.cc
    Line 23, Patchset 17 (Latest): // dedicated `SequencedTaskRunner.
    Hiroshige Hayashizaki . unresolved

    nit:
    ```
    `SequencedTaskRunner`
    ```
    (missing closing quote).

    Line 93, Patchset 17 (Latest): // ResourceRequest copy is needed here. Please see crbug.com/444482515 and
    Hiroshige Hayashizaki . unresolved

    Probably we don't need copy here, especially because preprefetch container doesn't handle redirects for now.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroki Nakagawa
    • Taiyo Mizuhashi
    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: I599e705d5b90064768a524c1e313ad147fa3cdab
    Gerrit-Change-Number: 7559092
    Gerrit-PatchSet: 17
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Kouhei Ueno <kou...@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: Thu, 05 Mar 2026 23:20:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroki Nakagawa (Gerrit)

    unread,
    Mar 6, 2026, 12:02:35 AM (7 days ago) Mar 6
    to Taiyo Mizuhashi, Ken Okada, Kouhei Ueno, AyeAye, Hiroshige Hayashizaki, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
    Attention needed from Taiyo Mizuhashi

    Hiroki Nakagawa added 2 comments

    File content/browser/preloading/prefetch/pre_prefetch_container.h
    Line 31, Patchset 17 (Latest):// combines ctor and constructor and Start(). This is always called from
    Hiroki Nakagawa . unresolved

    ctor and constructor

    This repeats the same thing.

    File content/browser/preloading/prefetch/pre_prefetch_container.cc
    Line 45, Patchset 16: return container;
    Ken Okada . unresolved

    `return std::move(container)` (Or, it is using NVRO?)

    Hiroki Nakagawa

    Yes, this is valid and more preferable than explicit `std::move`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Taiyo Mizuhashi
    Gerrit-Comment-Date: Fri, 06 Mar 2026 05:02:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Ken Okada <ken...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Taiyo Mizuhashi (Gerrit)

    unread,
    Mar 9, 2026, 3:21:48 AM (4 days ago) Mar 9
    to Hiroki Nakagawa, Ken Okada, Kouhei Ueno, AyeAye, Hiroshige Hayashizaki, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
    Attention needed from Hiroki Nakagawa, Hiroshige Hayashizaki and Ken Okada

    Taiyo Mizuhashi voted and added 10 comments

    Votes added by Taiyo Mizuhashi

    Commit-Queue+1

    10 comments

    File content/browser/loader/navigation_url_loader_impl.h
    Line 617, Patchset 16:// details).
    Ken Okada . resolved

    s/details/details./

    Taiyo Mizuhashi

    Done

    File content/browser/preloading/prefetch/pre_prefetch_container.h
    Line 38, Patchset 17:class CONTENT_EXPORT PrePrefetchContainer {
    Hiroshige Hayashizaki . resolved

    nit: final

    Taiyo Mizuhashi

    Done

    Line 31, Patchset 17:// combines ctor and constructor and Start(). This is always called from
    Hiroki Nakagawa . resolved

    ctor and constructor

    This repeats the same thing.

    Taiyo Mizuhashi

    Done

    Line 30, Patchset 16:// - This is always created from static function `CreateAndStart()`, which
    Ken Okada . resolved

    via?

    Taiyo Mizuhashi

    Done

    File content/browser/preloading/prefetch/pre_prefetch_container.cc
    Line 23, Patchset 17: // dedicated `SequencedTaskRunner.
    Hiroshige Hayashizaki . resolved

    nit:
    ```
    `SequencedTaskRunner`
    ```
    (missing closing quote).

    Taiyo Mizuhashi

    Done

    Line 45, Patchset 16: return container;
    Ken Okada . resolved

    `return std::move(container)` (Or, it is using NVRO?)

    Hiroki Nakagawa

    Yes, this is valid and more preferable than explicit `std::move`.

    Taiyo Mizuhashi

    yes, thanks!

    Line 54, Patchset 16: DCHECK(!BrowserThread::CurrentlyOn(content::BrowserThread::UI));
    Ken Okada . resolved

    Why `DCEHCK`? I believe that it should be `CHECK`.

    Taiyo Mizuhashi

    Actually I thought a bit. maybe as a common practice, DCHECK is heavily used for thread checks e.g. the call site number of `CHECK_CURRENTLY_ON` vs `DCHECK_CURRENTLY_ON` is "68 vs 32441, which I just followed this first.

    anyway CHECK is always preferred (as we chatted before IIUC) so change this to CHECK here. lmk if you have thoughts.

    One thing in my mind is performance concerns so maybe I can replace it all at once and do a local test after all CLs are settled.

    Line 80, Patchset 16: net::IsolationInfo::RequestType::kMainFrame, origin, origin,
    Ken Okada . resolved

    Could you add comment `/*arg=*/`?

    Taiyo Mizuhashi

    Done

    Line 86, Patchset 16: /*devtools_observer=*/mojo::NullRemote(), net::RequestPriority::HIGHEST,
    Ken Okada . unresolved

    Could you add a comment why we use HIGHEST here, while ordinal prefetch uses `PrefetchPriority`. (Or, we'll loose the context in the futurue.)

    Taiyo Mizuhashi

    I believe this is covered by the above comment stating " Construct a proper PrePrefetch, using the prefetch common utility." After we can use the common `ResourceRequest` utility, it should be calculated from `PrefetchPriority` given by `PrefetchRequest`.

    https://source.chromium.org/chromium/chromium/src/+/main:content/browser/preloading/prefetch/prefetch_container.cc;l=1473-1525;drc=400e49c0ae7ee0887d7a812fea6eec06720bc1d9?q=prefetch_container.cc

    Line 93, Patchset 17: // ResourceRequest copy is needed here. Please see crbug.com/444482515 and
    Hiroshige Hayashizaki . unresolved

    Probably we don't need copy here, especially because preprefetch container doesn't handle redirects for now.

    Taiyo Mizuhashi

    oh ack, let me have a time tomorrow to check by myself

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroki Nakagawa
    • Hiroshige Hayashizaki
    • Ken Okada
    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: I599e705d5b90064768a524c1e313ad147fa3cdab
    Gerrit-Change-Number: 7559092
    Gerrit-PatchSet: 20
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Kouhei Ueno <kou...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Attention: Ken Okada <ken...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Mar 2026 07:21:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    Comment-In-Reply-To: Hiroki Nakagawa <nhi...@chromium.org>
    Comment-In-Reply-To: Ken Okada <ken...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroshige Hayashizaki (Gerrit)

    unread,
    Mar 9, 2026, 6:53:13 PM (3 days ago) Mar 9
    to Taiyo Mizuhashi, Hiroki Nakagawa, Ken Okada, Kouhei Ueno, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
    Attention needed from Hiroki Nakagawa, Ken Okada and Taiyo Mizuhashi

    Hiroshige Hayashizaki added 5 comments

    Patchset-level comments
    File-level comment, Patchset 22 (Latest):
    Hiroshige Hayashizaki . resolved

    Basically looks good.

    File content/browser/preloading/prefetch/pre_prefetch_container.h
    Line 34, Patchset 22 (Latest):// shouldn't be acceeed except for 1) dtor of `PrePrefetchHandle` or 2)
    Hiroshige Hayashizaki . unresolved

    nit: typo (accessed)

    Line 32, Patchset 22 (Latest):// `PrePrefetchServiceImpl`, which is always on its sequence.
    Hiroshige Hayashizaki . unresolved

    I think it's better to explicitly name the sequence, e.g.
    the `PrePrefetchServiceCore` sequence or
    the `PrePrefetchServiceImpl` sequence.
    ditto elsewhere in this CL (and other CLs).

    Threading is very complicated in general, and thus let's count, name and mention the threads/sequences explicitly and concisely. IIUC there are three things (am I understanding correctly?):

    • The UI thread,
    • The `PrePrefetchServiceCore` sequence, and
    • Any thread/sequence that calls `StartPrePrefetch`.
    File content/browser/preloading/prefetch/pre_prefetch_container.cc
    Line 16, Patchset 22 (Latest):
    Hiroshige Hayashizaki . unresolved

    How about organizing the cc file based on threading? e.g.

    ```
    // ----------------------------------------------------------------
    // Methods to be called from the `PrePrefetchServiceCore` sequence.

    (all methods except for dtor)

    // ----------------------------------------------------------------
    // Methods that can be called from any thread.

    (dtor)
    ```

    Line 21, Patchset 22 (Latest): mojo::PendingRemote<network::mojom::URLLoaderFactory> url_loader_factory) {
    Hiroshige Hayashizaki . unresolved

    optional: perhaps it's better to explicitly CHECK the sequence affinity, i.e.
    passing `const PrePrefetchServiceImpl&` here and all other methods and introduce/call `PrePrefetchServiceImpl::CheckCalledOnValidSequence()` or so.

    (but for now it's also OK to land this and iterate refining later)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroki Nakagawa
    • Ken Okada
    • Taiyo Mizuhashi
    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: I599e705d5b90064768a524c1e313ad147fa3cdab
    Gerrit-Change-Number: 7559092
    Gerrit-PatchSet: 22
    Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
    Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-CC: Kouhei Ueno <kou...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Attention: Ken Okada <ken...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Mar 2026 22:52:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroki Nakagawa (Gerrit)

    unread,
    Mar 10, 2026, 10:39:20 AM (2 days ago) Mar 10
    to Taiyo Mizuhashi, Ken Okada, Kouhei Ueno, AyeAye, Hiroshige Hayashizaki, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
    Attention needed from Ken Okada and Taiyo Mizuhashi

    Hiroki Nakagawa voted and added 9 comments

    Votes added by Hiroki Nakagawa

    Code-Review+1

    9 comments

    Patchset-level comments
    Hiroki Nakagawa . resolved

    LGTM, thanks!

    Commit Message
    Line 18, Patchset 22 (Latest):combines ctor and constructor and Start(). This is always called from
    Hiroki Nakagawa . unresolved

    ctor and constructor (repeating)

    Line 20, Patchset 22 (Latest):- After being created, this should currently be owned by `PrePrefetchHandle`, and shouldn't be accessed except for 1) dtor of `PrePrefetchHandle` or 2) PrePrefetch consumption happening on the UI thread, which both terminates the lifetime of `this`.
    Hiroki Nakagawa . unresolved

    These may be too detailed for the CL description. Instead, we could simply say:

    Regarding the thread/lifetime model of the PrePrefetchContainer, see the class comment.

    Bonus: This saves us from having to keep the CL description in sync with the class comment after typo fixes

    Line 24, Patchset 22 (Latest):- We should construct a proper `ResourceRequest` for `PrePrefetch`, using the prefetch common utility (This will be done at least after crbug.com/483079815 is resolved). In addition to that, we also take care of some modification done on proxied `URLLoaderFactory` [2]. To do these, we should take care of those properties that are UI-thread dependent / that are tied to the embedder (See the comment of `PrePrefetchServiceImpl::ctor`).
    Hiroki Nakagawa . unresolved

    Can you run the "format"?

    File content/browser/loader/navigation_url_loader_impl.h
    Line 615, Patchset 22 (Latest):// from non-UI thread when preprefetching. (Please see
    Hiroki Nakagawa . unresolved

    pre-prefetching

    File content/browser/preloading/prefetch/pre_prefetch_container.cc
    Line 89, Patchset 22 (Latest): auto receiver = url_loader_.InitWithNewPipeAndPassReceiver();
    auto client_remote =
    url_loader_client_receiver_.InitWithNewPipeAndPassRemote();
    Hiroki Nakagawa . unresolved

    Can we inline these two lines into the `CreateLoaderAndStart` call?

    File content/browser/preloading/prefetch/pre_prefetch_container_unittest.cc
    Line 73, Patchset 22 (Latest):TEST_F(PrePrefetchContainerTest, StartPrePrefetch) {
    Hiroki Nakagawa . unresolved

    Can you briefly explain what the purpose of this test? IIUC,

    // This test confirm that `PrePrefetchContainer` starts and sends a network request when `PrePrefetchContainer::CreateAndStart(ForTesting)` is called.

    Line 93, Patchset 22 (Latest): // Wait the request is received and the container is created.
    Hiroki Nakagawa . unresolved

    Wait until

    Line 97, Patchset 22 (Latest): CHECK(container);
    Hiroki Nakagawa . unresolved

    `ASSERT` (`CHECK` is not recommended in tests)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ken Okada
    • Taiyo Mizuhashi
    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: I599e705d5b90064768a524c1e313ad147fa3cdab
      Gerrit-Change-Number: 7559092
      Gerrit-PatchSet: 22
      Gerrit-Owner: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
      Gerrit-Reviewer: Ken Okada <ken...@chromium.org>
      Gerrit-Reviewer: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-CC: Kouhei Ueno <kou...@chromium.org>
      Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
      Gerrit-Attention: Taiyo Mizuhashi <ta...@chromium.org>
      Gerrit-Attention: Ken Okada <ken...@chromium.org>
      Gerrit-Comment-Date: Tue, 10 Mar 2026 14:38:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ken Okada (Gerrit)

      unread,
      Mar 11, 2026, 11:08:17 PM (23 hours ago) Mar 11
      to Taiyo Mizuhashi, Hiroki Nakagawa, Kouhei Ueno, AyeAye, Hiroshige Hayashizaki, Chromium LUCI CQ, chromium...@chromium.org, prerendering-reviews, loading...@chromium.org, gavin...@chromium.org, tburkar...@chromium.org
      Attention needed from Taiyo Mizuhashi

      Ken Okada voted and added 2 comments

      Votes added by Ken Okada

      Code-Review+1

      2 comments

      Patchset-level comments
      Ken Okada . resolved

      LGTM % `s/a/an/`

      File content/browser/preloading/prefetch/pre_prefetch_container.cc
      Line 86, Patchset 16: /*devtools_observer=*/mojo::NullRemote(), net::RequestPriority::HIGHEST,
      Ken Okada . resolved

      Could you add a comment why we use HIGHEST here, while ordinal prefetch uses `PrefetchPriority`. (Or, we'll loose the context in the futurue.)

      Taiyo Mizuhashi

      I believe this is covered by the above comment stating " Construct a proper PrePrefetch, using the prefetch common utility." After we can use the common `ResourceRequest` utility, it should be calculated from `PrefetchPriority` given by `PrefetchRequest`.

      https://source.chromium.org/chromium/chromium/src/+/main:content/browser/preloading/prefetch/prefetch_container.cc;l=1473-1525;drc=400e49c0ae7ee0887d7a812fea6eec06720bc1d9?q=prefetch_container.cc

      Ken Okada

      Acknowledged

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Taiyo Mizuhashi
      Gerrit-Comment-Date: Thu, 12 Mar 2026 03:07:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Taiyo Mizuhashi <ta...@chromium.org>
      Comment-In-Reply-To: Ken Okada <ken...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages