[loader] Size the file:// response pipe to the file, capped at 2 MiB [chromium/src : main]

0 views
Skip to first unread message

Shelley Vohr (Gerrit)

unread,
Aug 18, 2026, 7:20:40 AM (2 days ago) Aug 18
to android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, loading...@chromium.org
Attention needed from Shelley Vohr

Message from Shelley Vohr

Set Ready For Review

Open in Gerrit

Related details

Attention is currently required from:
  • Shelley Vohr
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: Ia7e84fe4b8f265be9a2251f3c2d6073e70fdc481
Gerrit-Change-Number: 8262781
Gerrit-PatchSet: 1
Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
Gerrit-Comment-Date: Tue, 18 Aug 2026 11:20:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kenichi Ishibashi (Gerrit)

unread,
Aug 18, 2026, 7:52:24 PM (2 days ago) Aug 18
to Shelley Vohr, Adam Rice, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, loading...@chromium.org
Attention needed from Adam Rice and Shelley Vohr

Kenichi Ishibashi voted and added 1 comment

Votes added by Kenichi Ishibashi

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Kenichi Ishibashi . resolved

looks reasonable to me, please wait for ricea@'s review.

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
  • Shelley Vohr
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement 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: Ia7e84fe4b8f265be9a2251f3c2d6073e70fdc481
Gerrit-Change-Number: 8262781
Gerrit-PatchSet: 1
Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Attention: Adam Rice <ri...@chromium.org>
Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
Gerrit-Comment-Date: Tue, 18 Aug 2026 23:51:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Rice (Gerrit)

unread,
2:49 AM (9 hours ago) 2:49 AM
to Shelley Vohr, Kenichi Ishibashi, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, loading...@chromium.org
Attention needed from Shelley Vohr

Adam Rice voted and added 1 comment

Votes added by Adam Rice

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Adam Rice . resolved

lgtm, good find, thank you.

Open in Gerrit

Related details

Attention is currently required from:
  • Shelley Vohr
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: Ia7e84fe4b8f265be9a2251f3c2d6073e70fdc481
    Gerrit-Change-Number: 8262781
    Gerrit-PatchSet: 3
    Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
    Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Attention: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Comment-Date: Thu, 20 Aug 2026 06:49:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Shelley Vohr (Gerrit)

    unread,
    4:14 AM (8 hours ago) 4:14 AM
    to Adam Rice, Kenichi Ishibashi, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, loading...@chromium.org

    Shelley Vohr voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    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: Ia7e84fe4b8f265be9a2251f3c2d6073e70fdc481
    Gerrit-Change-Number: 8262781
    Gerrit-PatchSet: 3
    Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
    Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Comment-Date: Thu, 20 Aug 2026 08:14:41 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    5:13 AM (7 hours ago) 5:13 AM
    to Shelley Vohr, Adam Rice, Kenichi Ishibashi, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, loading...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    [loader] Size the file:// response pipe to the file, capped at 2 MiB

    FileURLLoader asks for the "larger" 2 MiB data pipe for every file://
    response since https://crrev.com/c/3428154, which fixed slow loads of
    very large local files. The pipe's shared memory is created, fallocated
    and mapped up front by the browser and mapped again by the consumer, so
    for the common case of small local resources (an app shell's scripts,
    stylesheets and images, and every chrome-extension:// resource, which
    extensions::ExtensionProtocols loads through
    CreateFileURLLoaderBypassingSecurityChecks) most of the cost of the load
    is setting up and tearing down 2 MiB of shared memory to move a few KiB.

    The file size is known before the pipe is created, so clamp the capacity
    to [net::kMaxBytesToSniff, 2 MiB] using it. Files of 2 MiB and more get
    exactly the pipe they get today; smaller files get a pipe that still
    holds the whole file, so the number of producer/consumer round trips
    does not change, and the MIME sniffing buffer always fits.

    Measurements (Linux x64 official build; content_shell loading a page
    from file:// that XHRs local files of each size, per-request latency,
    30 interleaved fresh-process runs per side, medians; two sessions,
    headless and X11):
    1 KiB 1.37 -> 0.94 ms / 1.30 -> 0.97 ms
    16 KiB 1.31 -> 0.91 ms / 1.29 -> 0.91 ms
    64 KiB 1.43 -> 1.00 ms / 1.37 -> 1.00 ms
    256 KiB 1.66 -> 1.20 ms / 1.56 -> 1.22 ms
    1 MiB 2.60 -> 2.40 ms / 2.70 -> 2.58 ms
    4 MiB 5.95 -> 5.95 ms / 6.00 -> 6.05 ms (pipe unchanged)
    All rows up to 1 MiB p < 1e-9 (Welch and Mann-Whitney).

    Tested: content_unittests (FileURLLoaderFactoryTest.*),
    content_browsertests --gtest_filter=*FileURL*:NavigationBrowserTest.*:
    *Loader*:*Download*File*:*Fetch*, unit_tests ExtensionProtocolsTest.*,
    content_unittests loader tests under ASan; no behavior change for range
    requests, directory listings or files >= 2 MiB.
    Bug: none
    Change-Id: Ia7e84fe4b8f265be9a2251f3c2d6073e70fdc481
    Reviewed-by: Kenichi Ishibashi <ba...@chromium.org>
    Reviewed-by: Adam Rice <ri...@chromium.org>
    Commit-Queue: Shelley Vohr <shelle...@gmail.com>
    Cr-Commit-Position: refs/heads/main@{#1682968}
    Files:
    • M content/browser/loader/file_url_loader_factory.cc
    Change size: S
    Delta: 1 file changed, 13 insertions(+), 4 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Kenichi Ishibashi, +1 by Adam Rice
    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: Ia7e84fe4b8f265be9a2251f3c2d6073e70fdc481
    Gerrit-Change-Number: 8262781
    Gerrit-PatchSet: 4
    Gerrit-Owner: Shelley Vohr <shelle...@gmail.com>
    Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
    Gerrit-Reviewer: Shelley Vohr <shelle...@gmail.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages