Background compile JS extension scripts injected at document start [chromium/src : main]

85 views
Skip to first unread message

Luis Pardo (Gerrit)

unread,
Oct 10, 2025, 4:22:54 PMOct 10
to Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin

Luis Pardo voted and added 2 comments

Votes added by Luis Pardo

Commit-Queue+1

2 comments

Patchset-level comments
File-level comment, Patchset 10 (Latest):
Luis Pardo . resolved

@rdevlin...@chromium.org Can you take a look at this feature? Here is the related [design doc](https://docs.google.com/document/d/1gryv6WZItlP5VbuOwL9VtNnjbM8yvvFpEPnELXWGM9E/edit?usp=sharing). Also linked in the bug.

File extensions/renderer/script_injection_manager.cc
Line 521, Patchset 10 (Latest): // TODO(https://crbug.com/436274244): filter out frames that will not have any
// script injections.
Luis Pardo . unresolved

@rdevlin...@chromium.org Any suggestions on how to address this? It would be nice to only do this work once, so maybe refactoring to fill the pending injections here?

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
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: Idc6fc4e4f0a57f197ccba6ef04a77bba58c0ec8e
Gerrit-Change-Number: 6820371
Gerrit-PatchSet: 10
Gerrit-Owner: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Luis Pardo <lpardo...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Fri, 10 Oct 2025 20:22:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Devlin Cronin (Gerrit)

unread,
Oct 14, 2025, 8:00:57 PMOct 14
to Luis Pardo, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin and Luis Pardo

Devlin Cronin added 1 comment

Patchset-level comments
Devlin Cronin . unresolved

Thanks for the CL! Sorry, I haven't had a chance to get to this yet, but I hope to tomorrow.

One of the concerns I have here is that it seems like this would be difficult to determine if it's a net performance improvement. Moving the compilation to a background thread seems like it has the potential to slow down the compilation of document_start scripts, but since we block the page on the injection of document_start scripts, that would mean we block page load on that.

Is there a rollout plan to ensure we'll measure the impact of this and that we're not regressing any other important metrics?

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Luis Pardo
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: Idc6fc4e4f0a57f197ccba6ef04a77bba58c0ec8e
Gerrit-Change-Number: 6820371
Gerrit-PatchSet: 10
Gerrit-Owner: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Luis Pardo <lpardo...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Comment-Date: Wed, 15 Oct 2025 00:00:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Luis Pardo (Gerrit)

unread,
Oct 15, 2025, 12:29:21 PMOct 15
to Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin

Luis Pardo added 1 comment

Patchset-level comments
Devlin Cronin . unresolved

Thanks for the CL! Sorry, I haven't had a chance to get to this yet, but I hope to tomorrow.

One of the concerns I have here is that it seems like this would be difficult to determine if it's a net performance improvement. Moving the compilation to a background thread seems like it has the potential to slow down the compilation of document_start scripts, but since we block the page on the injection of document_start scripts, that would mean we block page load on that.

Is there a rollout plan to ensure we'll measure the impact of this and that we're not regressing any other important metrics?

Luis Pardo

I added an [experimentation plan section](https://docs.google.com/document/d/1gryv6WZItlP5VbuOwL9VtNnjbM8yvvFpEPnELXWGM9E/edit?tab=t.0) to the design doc. We'll run an experiment with First Contentful Paint as the success metric, this should catch any regressions on page load, we are also adding other metrics for parameter tunning. I don't think I can run finch trials in Chrome, so I'm setting up the infrastructure in this CL and I'll run the experiment on Edge, it would be great if someone could run the in the Chrome side too.

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
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: Idc6fc4e4f0a57f197ccba6ef04a77bba58c0ec8e
Gerrit-Change-Number: 6820371
Gerrit-PatchSet: 10
Gerrit-Owner: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Luis Pardo <lpardo...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 16:28:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Devlin Cronin <rdevlin...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Luis Pardo (Gerrit)

unread,
Nov 7, 2025, 1:55:19 PMNov 7
to Sohail Rajdev, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin and Sohail Rajdev

Luis Pardo added 1 comment

Patchset-level comments
Luis Pardo . resolved

@sora...@microsoft.com PTAL, thanks.

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Sohail Rajdev
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: Idc6fc4e4f0a57f197ccba6ef04a77bba58c0ec8e
Gerrit-Change-Number: 6820371
Gerrit-PatchSet: 10
Gerrit-Owner: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Sohail Rajdev <sora...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Sohail Rajdev <sora...@microsoft.com>
Gerrit-Comment-Date: Fri, 07 Nov 2025 18:55:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sohail Rajdev (Gerrit)

unread,
Nov 10, 2025, 7:29:02 AMNov 10
to Luis Pardo, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin and Luis Pardo

Sohail Rajdev added 1 comment

Patchset-level comments
Sohail Rajdev . resolved

I see that the design document doesn't have an LGTM from extensions/OWNERS. Please add me again once the design document is signed off from an extensions POV 😊

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Luis Pardo
Gerrit-Attention: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Comment-Date: Mon, 10 Nov 2025 12:28:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Tim (Gerrit)

unread,
Nov 25, 2025, 8:16:18 PMNov 25
to Luis Pardo, Sohail Rajdev, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin and Luis Pardo

Tim added 2 comments

Patchset-level comments
Tim . resolved

Doing a bit of a drive-by here saying I think this seems reasonable to experiment with from the extensions side, with it guarded behind the feature flag.

Side note, I think the code coverage check is being thrown off by whatever these ClangTidy build warnings are. I'm going to see if another pass through the bots clears them up.

File third_party/blink/renderer/bindings/core/v8/script_streamer.h
Line 332, Patchset 10 (Latest): bool timed_out_;
Tim . unresolved

nit: `bool timed_out_ = false;`

This looks like the only real ClangTidy message (although the AttachedFix appears to be backwards somehow). I'm not sure what is up with the other ones though?

Gerrit-CC: Tim <tjud...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Comment-Date: Wed, 26 Nov 2025 01:16:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Luis Pardo (Gerrit)

unread,
Nov 26, 2025, 4:50:53 PMNov 26
to Tim, Sohail Rajdev, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin and Tim

Luis Pardo voted and added 2 comments

Votes added by Luis Pardo

Commit-Queue+1

2 comments

Patchset-level comments
Tim . resolved

Doing a bit of a drive-by here saying I think this seems reasonable to experiment with from the extensions side, with it guarded behind the feature flag.

Side note, I think the code coverage check is being thrown off by whatever these ClangTidy build warnings are. I'm going to see if another pass through the bots clears them up.

Luis Pardo

Seems like fixing the real warning and rebasing fixed those.

File third_party/blink/renderer/bindings/core/v8/script_streamer.h
Line 332, Patchset 10: bool timed_out_;
Tim . resolved

nit: `bool timed_out_ = false;`

This looks like the only real ClangTidy message (although the AttachedFix appears to be backwards somehow). I'm not sure what is up with the other ones though?

Luis Pardo

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Tim
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: Idc6fc4e4f0a57f197ccba6ef04a77bba58c0ec8e
Gerrit-Change-Number: 6820371
Gerrit-PatchSet: 13
Gerrit-Owner: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Sohail Rajdev <sora...@microsoft.com>
Gerrit-Reviewer: Tim <tjud...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Tim <tjud...@chromium.org>
Gerrit-Comment-Date: Wed, 26 Nov 2025 21:50:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Tim <tjud...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Luis Pardo (Gerrit)

unread,
Dec 9, 2025, 1:56:51 PM (5 days ago) Dec 9
to Tim, Sohail Rajdev, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin and Tim

Luis Pardo added 1 comment

Patchset-level comments
File-level comment, Patchset 13 (Latest):
Luis Pardo . unresolved

@rdevlin...@chromium.org Friendly ping about this CL.

Gerrit-Comment-Date: Tue, 09 Dec 2025 18:56:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Devlin Cronin (Gerrit)

unread,
Dec 11, 2025, 2:42:49 PM (3 days ago) Dec 11
to Luis Pardo, Tim, Sohail Rajdev, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Luis Pardo and Tim

Devlin Cronin added 10 comments

Patchset-level comments
Devlin Cronin . resolved

Thanks, Luis! Sorry for the delay here; I thought this was waiting on Tim's review. My mistake.

File chrome/browser/extensions/content_script_apitest.cc
Line 2599, Patchset 13 (Latest): while (true) {
Devlin Cronin . unresolved

I think base::test::RunUntil() would be a bit cleaner here.

Line 2655, Patchset 13 (Latest): "js": ["script1.js", "script2.js"],
Devlin Cronin . unresolved

Two suggestions:

  • Can we use different scripts here, so that if kNonBlockingScript ends up changing, it doesn't break this test? (The NonBlocking aspect just means it doesn't block JS execution; it has nothing to do with script size or compilation)
  • Can we verify that these scripts are executed at document_start, so that we guarantee that we don't invalidate assumptions of scripts injected at that point?
File extensions/common/extension_features.h
Line 120, Patchset 13 (Latest):BASE_DECLARE_FEATURE(kExtensionsIgnoreBackgroundCompilationForExperiment);
Devlin Cronin . unresolved

I'm not quite sure I understand why we need both of these. Wouldn't we just disable the background compilation feature entirely?

File extensions/renderer/extension_frame_helper.h
Line 38, Patchset 13 (Latest): ExtensionsStreamSourceMap;
Devlin Cronin . unresolved

prefer `using` in new code

File extensions/renderer/script_injection.h
Line 99, Patchset 13 (Latest): void StartStreamingJSSources();
Devlin Cronin . unresolved

add a function comment

File extensions/renderer/script_injection_manager.h
Line 69, Patchset 13 (Latest): void StartStreamingJSSources(blink::WebLocalFrame* web_frame,
Devlin Cronin . unresolved

here, too, add a function comment

File extensions/renderer/script_injection_manager.cc
Line 521, Patchset 10: // TODO(https://crbug.com/436274244): filter out frames that will not have any
// script injections.
Luis Pardo . unresolved

@rdevlin...@chromium.org Any suggestions on how to address this? It would be nice to only do this work once, so maybe refactoring to fill the pending injections here?

Devlin Cronin

Yeah, I'd very much like to avoid doing this matching multiple times -- and this matching is also incomplete.

How much of a cost is there to getting this "wrong"? This might match scripts we don't end up injecting; will that result in significant wasted time?

One of the approaches I'm wondering about is whether we should just store these pending scripts on the ExtensionFrameLoader. It's already the one that's triggering both this call (in ReadyToCommitNavigation) and the call to InjectScripts (when the document element is available). We could fetch the scripts in ReadyToCommit, store them, and then pass those in as scripts to run when injecting the scripts. One concern there is whether the frame could be meaningfully changed between those points in a way that the script would no longer match; for that, I wonder if we should perform a secondary match on the originally-matching scripts to verify they still match (that should be cheaper, since it's a subset of the total scripts).

Line 533, Patchset 13 (Latest): frame_helper->ClearScriptStreamers();
Devlin Cronin . unresolved

Can the FrameHelper handle this cleanup? It's aware of when we start a new load.

File extensions/renderer/user_script_injector.cc
Line 263, Patchset 13 (Latest): frame_helper->TakeScriptStreamerIfAvailable(script_url);
Devlin Cronin . unresolved

it's interesting to me that these are single-use streamers. Can you expand on what the benefit of that is, compared to a longer-lived streamer-per-URL? (My understanding from skimming the blink code is that they all map to a ref-counted underlying streamer anyway?)

Open in Gerrit

Related details

Attention is currently required from:
  • Luis Pardo
  • Tim
Gerrit-Attention: Tim <tjud...@chromium.org>
Gerrit-Attention: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Comment-Date: Thu, 11 Dec 2025 19:42:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Luis Pardo <lpardo...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Luis Pardo (Gerrit)

unread,
Dec 12, 2025, 8:30:35 PM (2 days ago) Dec 12
to Tim, Sohail Rajdev, Devlin Cronin, Chromium LUCI CQ, Chromium Metrics Reviews, Kentaro Hara, Raphael Kubo da Costa, chromium...@chromium.org, AyeAye, asvitkine...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, blink-revi...@chromium.org
Attention needed from Devlin Cronin

Luis Pardo added 7 comments

Patchset-level comments
File-level comment, Patchset 15 (Latest):
Luis Pardo . resolved

Addressed some feedback, still working through the remaining comments

File chrome/browser/extensions/content_script_apitest.cc
Devlin Cronin . unresolved

I think base::test::RunUntil() would be a bit cleaner here.

Luis Pardo

I've never done one of this, please let me know if it is correct. The `base::test::Util` documentation has note about flakiness that I don't fully understand.

File extensions/common/extension_features.h
Line 120, Patchset 13:BASE_DECLARE_FEATURE(kExtensionsIgnoreBackgroundCompilationForExperiment);
Devlin Cronin . unresolved

I'm not quite sure I understand why we need both of these. Wouldn't we just disable the background compilation feature entirely?

Luis Pardo

I'm not sure how experimentation works in Chrome. I'd like to compare users that are actively affected by the feature vs those that would have been affected but are part of the control population. I think we need the second flag for this.

File extensions/renderer/extension_frame_helper.h
Line 38, Patchset 13: ExtensionsStreamSourceMap;
Devlin Cronin . resolved

prefer `using` in new code

Luis Pardo

Done

File extensions/renderer/script_injection.h
Line 99, Patchset 13: void StartStreamingJSSources();
Devlin Cronin . resolved

add a function comment

Luis Pardo

Woops, this is an artifact from old code.

File extensions/renderer/script_injection_manager.h
Line 69, Patchset 13: void StartStreamingJSSources(blink::WebLocalFrame* web_frame,
Devlin Cronin . resolved

here, too, add a function comment

Luis Pardo

Done

File extensions/renderer/user_script_injector.cc
Line 263, Patchset 13: frame_helper->TakeScriptStreamerIfAvailable(script_url);
Devlin Cronin . unresolved

it's interesting to me that these are single-use streamers. Can you expand on what the benefit of that is, compared to a longer-lived streamer-per-URL? (My understanding from skimming the blink code is that they all map to a ref-counted underlying streamer anyway?)

Luis Pardo

There is always one streamer object for each streamed script. In blink, the `InlineScriptStreamer` holds a ref-counted background streamer for thread-safety purposes. In fact, each Inline streamer in blink is [keyed by the full source text of the script](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/script/classic_pending_script.cc;l=56;drc=6fe04ac5cd13eaa7013d9da4b94144b4caa1fabf#:~:text=//%20The%20inline%20script,to%20compile%20here.).

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
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: Idc6fc4e4f0a57f197ccba6ef04a77bba58c0ec8e
Gerrit-Change-Number: 6820371
Gerrit-PatchSet: 15
Gerrit-Owner: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Luis Pardo <lpardo...@microsoft.com>
Gerrit-Reviewer: Sohail Rajdev <sora...@microsoft.com>
Gerrit-Reviewer: Tim <tjud...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Sat, 13 Dec 2025 01:30:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Devlin Cronin <rdevlin...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages