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

0 views
Skip to first unread message

Emmanuel Romero Ruiz (Gerrit)

unread,
Jan 20, 2026, 12:08:12 PMJan 20
to Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Emmanuel Romero Ruiz

Message from Emmanuel Romero Ruiz

Set Ready For Review

Open in Gerrit

Related details

Attention is currently required from:
  • Emmanuel Romero Ruiz
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: I5b0237406552297b7007a43357cbc6ff19e339b1
Gerrit-Change-Number: 7404059
Gerrit-PatchSet: 6
Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@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: Emmanuel Romero Ruiz <emro...@microsoft.com>
Gerrit-Comment-Date: Tue, 20 Jan 2026 17:08:03 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Emmanuel Romero Ruiz (Gerrit)

unread,
Jan 20, 2026, 12:13:35 PMJan 20
to Jeremy Roman, Devlin Cronin, Leszek Swirski, Justin Lulejian, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Devlin Cronin, Jeremy Roman, Justin Lulejian and Leszek Swirski

Emmanuel Romero Ruiz added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Emmanuel Romero Ruiz . resolved

Hi, I am raising the CL for background compile again

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Jeremy Roman
  • Justin Lulejian
  • Leszek Swirski
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: I5b0237406552297b7007a43357cbc6ff19e339b1
Gerrit-Change-Number: 7404059
Gerrit-PatchSet: 6
Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@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: Justin Lulejian <jlul...@chromium.org>
Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Tue, 20 Jan 2026 17:13:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Justin Lulejian (Gerrit)

unread,
Jan 21, 2026, 10:04:22 AMJan 21
to Emmanuel Romero Ruiz, Jeremy Roman, Devlin Cronin, Leszek Swirski, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Devlin Cronin, Emmanuel Romero Ruiz, Jeremy Roman and Leszek Swirski

Justin Lulejian voted and added 2 comments

Votes added by Justin Lulejian

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Justin Lulejian . resolved

lgtm with a nit, thanks Emmanuel!

File tools/metrics/histograms/metadata/extensions/histograms.xml
Line 369, Patchset 7 (Latest): <token key="State">
<variant name="Success"
summary="Script was successfully compiled in the background."/>
<variant name="TimedOut"
summary="Main thread timed out while waiting for background
compilation to finish."/>
</token>
Justin Lulejian . unresolved

nit: apologies I didn't notice this before, but this and the duplicate below can be deduplicated using the variant syntax. See `<variants name="ChannelType">...</variant>` at the top of the file for an example for how it's done.

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
  • Emmanuel Romero Ruiz
  • Jeremy Roman
  • Leszek Swirski
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: I5b0237406552297b7007a43357cbc6ff19e339b1
    Gerrit-Change-Number: 7404059
    Gerrit-PatchSet: 7
    Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
    Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Leszek Swirski <les...@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: Jeremy Roman <jbr...@chromium.org>
    Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Wed, 21 Jan 2026 15:04:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Leszek Swirski (Gerrit)

    unread,
    Jan 21, 2026, 10:40:14 AMJan 21
    to Emmanuel Romero Ruiz, Justin Lulejian, Jeremy Roman, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
    Attention needed from Devlin Cronin, Emmanuel Romero Ruiz and Jeremy Roman

    Leszek Swirski voted and added 1 comment

    Votes added by Leszek Swirski

    Code-Review+1

    1 comment

    Patchset-level comments
    Leszek Swirski . resolved

    v8 lgtm

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Devlin Cronin
    • Emmanuel Romero Ruiz
    • Jeremy Roman
    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: I5b0237406552297b7007a43357cbc6ff19e339b1
      Gerrit-Change-Number: 7404059
      Gerrit-PatchSet: 7
      Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
      Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
      Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
      Gerrit-Reviewer: Leszek Swirski <les...@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: Jeremy Roman <jbr...@chromium.org>
      Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
      Gerrit-Comment-Date: Wed, 21 Jan 2026 15:39:55 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Justin Lulejian (Gerrit)

      unread,
      Jan 21, 2026, 12:47:12 PMJan 21
      to Emmanuel Romero Ruiz, Leszek Swirski, Jeremy Roman, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
      Attention needed from Devlin Cronin, Emmanuel Romero Ruiz, Jeremy Roman and Leszek Swirski

      Justin Lulejian voted and added 1 comment

      Votes added by Justin Lulejian

      Code-Review+1

      1 comment

      File tools/metrics/histograms/metadata/extensions/histograms.xml
      Line 369, Patchset 7: <token key="State">

      <variant name="Success"
      summary="Script was successfully compiled in the background."/>
      <variant name="TimedOut"
      summary="Main thread timed out while waiting for background
      compilation to finish."/>
      </token>
      Justin Lulejian . resolved

      nit: apologies I didn't notice this before, but this and the duplicate below can be deduplicated using the variant syntax. See `<variants name="ChannelType">...</variant>` at the top of the file for an example for how it's done.

      Justin Lulejian

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Devlin Cronin
      • Emmanuel Romero Ruiz
      • Jeremy Roman
      • Leszek Swirski
      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: I5b0237406552297b7007a43357cbc6ff19e339b1
        Gerrit-Change-Number: 7404059
        Gerrit-PatchSet: 8
        Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
        Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
        Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
        Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
        Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Reviewer: Leszek Swirski <les...@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: Jeremy Roman <jbr...@chromium.org>
        Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
        Gerrit-Attention: Leszek Swirski <les...@chromium.org>
        Gerrit-Comment-Date: Wed, 21 Jan 2026 17:47:03 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Justin Lulejian <jlul...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Jeremy Roman (Gerrit)

        unread,
        Jan 22, 2026, 11:52:36 AMJan 22
        to Emmanuel Romero Ruiz, Justin Lulejian, Leszek Swirski, Jeremy Roman, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
        Attention needed from Devlin Cronin, Emmanuel Romero Ruiz and Leszek Swirski

        Jeremy Roman added 2 comments

        File third_party/blink/renderer/core/html/parser/background_html_scanner.cc
        Line 219, Patchset 8 (Latest): task_runner->PostNonNestableTask(
        Jeremy Roman . unresolved

        Is it necessary to post back to main for this? UMA histograms are thread-safe; is TimedOut not safe to access from the other thread for some reason?

        Line 213, Patchset 8 (Latest): PostCrossThreadTask(
        *task_runner_, FROM_HERE,
        CrossThreadBindOnce(
        [](scoped_refptr<BackgroundInlineScriptStreamer> streamer,
        scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
        streamer->Run();
        task_runner->PostNonNestableTask(
        FROM_HERE,
        ConvertToBaseOnceCallback(CrossThreadBindOnce(
        &EmitHTMLInlineCompilationHistograms,
        std::move(streamer))));
        },
        streamer, main_thread_task_runner_));
        } else {
        worker_pool::PostTask(
        FROM_HERE, {base::TaskPriority::USER_BLOCKING},
        CrossThreadBindOnce(
        [](scoped_refptr<BackgroundInlineScriptStreamer> streamer,
        scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
        streamer->Run();
        task_runner->PostNonNestableTask(
        FROM_HERE,
        ConvertToBaseOnceCallback(CrossThreadBindOnce(
        &EmitHTMLInlineCompilationHistograms,
        std::move(streamer))));
        },
        streamer, main_thread_task_runner_));
        Jeremy Roman . unresolved

        Are these branches identical except for where the task is posted? If so, could we move the CrossThreadBindOnce outside it, so only the PostCrossThreadTask or worker_pool::PostTask is in the if statement?

        (They were duplicated before but they were pretty trivial at the time.)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Devlin Cronin
        • Emmanuel Romero Ruiz
        • Leszek Swirski
        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: I5b0237406552297b7007a43357cbc6ff19e339b1
          Gerrit-Change-Number: 7404059
          Gerrit-PatchSet: 8
          Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
          Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
          Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
          Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
          Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
          Gerrit-Reviewer: Leszek Swirski <les...@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: Emmanuel Romero Ruiz <emro...@microsoft.com>
          Gerrit-Attention: Leszek Swirski <les...@chromium.org>
          Gerrit-Comment-Date: Thu, 22 Jan 2026 16:52:23 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Emmanuel Romero Ruiz (Gerrit)

          unread,
          Jan 22, 2026, 6:57:58 PMJan 22
          to Justin Lulejian, Leszek Swirski, Jeremy Roman, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
          Attention needed from Devlin Cronin, Jeremy Roman, Justin Lulejian and Leszek Swirski

          Emmanuel Romero Ruiz added 2 comments

          File third_party/blink/renderer/core/html/parser/background_html_scanner.cc
          Line 219, Patchset 8: task_runner->PostNonNestableTask(
          Jeremy Roman . resolved

          Is it necessary to post back to main for this? UMA histograms are thread-safe; is TimedOut not safe to access from the other thread for some reason?

          Emmanuel Romero Ruiz

          You're correct that UMA histograms are thread-safe. I was following the pattern on extension_script_streamer.cc, but it seems there is a little more complex, since they access ElapsedTime and source_ and explicitly mention that it needs to be done in the main thread

          Line 213, Patchset 8: PostCrossThreadTask(
          Jeremy Roman . resolved

          Are these branches identical except for where the task is posted? If so, could we move the CrossThreadBindOnce outside it, so only the PostCrossThreadTask or worker_pool::PostTask is in the if statement?

          (They were duplicated before but they were pretty trivial at the time.)

          Emmanuel Romero Ruiz

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Devlin Cronin
          • Jeremy Roman
          • Justin Lulejian
          • Leszek Swirski
          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: I5b0237406552297b7007a43357cbc6ff19e339b1
            Gerrit-Change-Number: 7404059
            Gerrit-PatchSet: 9
            Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
            Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
            Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
            Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
            Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
            Gerrit-Reviewer: Leszek Swirski <les...@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: Justin Lulejian <jlul...@chromium.org>
            Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
            Gerrit-Attention: Leszek Swirski <les...@chromium.org>
            Gerrit-Comment-Date: Thu, 22 Jan 2026 23:57:49 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Jeremy Roman <jbr...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Jeremy Roman (Gerrit)

            unread,
            Jan 22, 2026, 10:15:59 PMJan 22
            to Emmanuel Romero Ruiz, Jeremy Roman, Justin Lulejian, Leszek Swirski, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
            Attention needed from Devlin Cronin, Emmanuel Romero Ruiz, Justin Lulejian and Leszek Swirski

            Jeremy Roman voted and added 2 comments

            Votes added by Jeremy Roman

            Code-Review+1

            2 comments

            File third_party/blink/renderer/core/html/parser/background_html_scanner.cc
            Line 45, Patchset 9 (Latest): scoped_refptr<BackgroundInlineScriptStreamer> script_streamer) {
            Jeremy Roman . unresolved

            nit: It's a bit weird for this to take ownership, since it only reads `const BackgroundInlineScriptStreamer&` would be simpler.

            Line 212, Patchset 9 (Latest): auto emit_histograms_callback = CrossThreadBindOnce(
            Jeremy Roman . unresolved

            While this does emit histograms, I assume the main purpose is Run(), so we should name it for that instead.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Devlin Cronin
            • Emmanuel Romero Ruiz
            • Justin Lulejian
            • Leszek Swirski
            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: I5b0237406552297b7007a43357cbc6ff19e339b1
              Gerrit-Change-Number: 7404059
              Gerrit-PatchSet: 9
              Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
              Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
              Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
              Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
              Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
              Gerrit-Reviewer: Leszek Swirski <les...@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: Justin Lulejian <jlul...@chromium.org>
              Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
              Gerrit-Attention: Leszek Swirski <les...@chromium.org>
              Gerrit-Comment-Date: Fri, 23 Jan 2026 03:15:45 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Emmanuel Romero Ruiz (Gerrit)

              unread,
              Jan 22, 2026, 10:54:03 PMJan 22
              to Jeremy Roman, Justin Lulejian, Leszek Swirski, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
              Attention needed from Devlin Cronin, Jeremy Roman, Justin Lulejian and Leszek Swirski

              Emmanuel Romero Ruiz added 2 comments

              File third_party/blink/renderer/core/html/parser/background_html_scanner.cc
              Line 45, Patchset 9: scoped_refptr<BackgroundInlineScriptStreamer> script_streamer) {
              Jeremy Roman . resolved

              nit: It's a bit weird for this to take ownership, since it only reads `const BackgroundInlineScriptStreamer&` would be simpler.

              Emmanuel Romero Ruiz

              I am passing a boolean now

              Line 212, Patchset 9: auto emit_histograms_callback = CrossThreadBindOnce(
              Jeremy Roman . resolved

              While this does emit histograms, I assume the main purpose is Run(), so we should name it for that instead.

              Emmanuel Romero Ruiz

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Devlin Cronin
              • Jeremy Roman
              • Justin Lulejian
              • Leszek Swirski
              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: I5b0237406552297b7007a43357cbc6ff19e339b1
                Gerrit-Change-Number: 7404059
                Gerrit-PatchSet: 11
                Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
                Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
                Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
                Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
                Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
                Gerrit-Reviewer: Leszek Swirski <les...@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: Justin Lulejian <jlul...@chromium.org>
                Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
                Gerrit-Attention: Leszek Swirski <les...@chromium.org>
                Gerrit-Comment-Date: Fri, 23 Jan 2026 03:53:51 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Devlin Cronin (Gerrit)

                unread,
                Jan 23, 2026, 5:34:08 PMJan 23
                to Emmanuel Romero Ruiz, Devlin Cronin, Jeremy Roman, Justin Lulejian, Leszek Swirski, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
                Attention needed from Emmanuel Romero Ruiz, Jeremy Roman, Justin Lulejian and Leszek Swirski

                Devlin Cronin voted and added 1 comment

                Votes added by Devlin Cronin

                Code-Review+1

                1 comment

                Patchset-level comments
                File-level comment, Patchset 11 (Latest):
                Devlin Cronin . resolved

                extensions LGTM; extensions code is unchanged from https://chromium-review.googlesource.com/c/chromium/src/+/6820371

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Emmanuel Romero Ruiz
                • Jeremy Roman
                • Justin Lulejian
                • Leszek Swirski
                  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: I5b0237406552297b7007a43357cbc6ff19e339b1
                  Gerrit-Change-Number: 7404059
                  Gerrit-PatchSet: 11
                  Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
                  Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
                  Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
                  Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
                  Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
                  Gerrit-Reviewer: Leszek Swirski <les...@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: Justin Lulejian <jlul...@chromium.org>
                  Gerrit-Attention: Jeremy Roman <jbr...@chromium.org>
                  Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
                  Gerrit-Attention: Leszek Swirski <les...@chromium.org>
                  Gerrit-Comment-Date: Fri, 23 Jan 2026 22:33:56 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: Yes
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Justin Lulejian (Gerrit)

                  unread,
                  Jan 26, 2026, 9:06:39 PMJan 26
                  to Emmanuel Romero Ruiz, Devlin Cronin, Jeremy Roman, Leszek Swirski, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
                  Attention needed from Emmanuel Romero Ruiz, Jeremy Roman and Leszek Swirski

                  Justin Lulejian voted and added 1 comment

                  Votes added by Justin Lulejian

                  Code-Review+1

                  1 comment

                  Patchset-level comments
                  Justin Lulejian . resolved

                  lgtm enums.xml restamp with no changes

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Emmanuel Romero Ruiz
                  • Jeremy Roman
                  • Leszek Swirski
                  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: I5b0237406552297b7007a43357cbc6ff19e339b1
                    Gerrit-Change-Number: 7404059
                    Gerrit-PatchSet: 11
                    Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
                    Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
                    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
                    Gerrit-Reviewer: Leszek Swirski <les...@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: Jeremy Roman <jbr...@chromium.org>
                    Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
                    Gerrit-Comment-Date: Tue, 27 Jan 2026 02:06:31 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    open
                    diffy

                    Emmanuel Romero Ruiz (Gerrit)

                    unread,
                    Jan 26, 2026, 9:10:19 PMJan 26
                    to Justin Lulejian, Devlin Cronin, Jeremy Roman, Leszek Swirski, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
                    Attention needed from Jeremy Roman and Leszek Swirski

                    Emmanuel Romero Ruiz added 1 comment

                    Patchset-level comments
                    Emmanuel Romero Ruiz . resolved

                    @jbr...@chromium.org @les...@chromium.org I wait for you look in the latest changes

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Jeremy Roman
                    • Leszek Swirski
                    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
                    Gerrit-Comment-Date: Tue, 27 Jan 2026 02:10:06 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    open
                    diffy

                    Leszek Swirski (Gerrit)

                    unread,
                    Jan 27, 2026, 5:53:03 AMJan 27
                    to Emmanuel Romero Ruiz, Justin Lulejian, Devlin Cronin, Jeremy Roman, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
                    Attention needed from Emmanuel Romero Ruiz and Jeremy Roman

                    Leszek Swirski voted and added 1 comment

                    Votes added by Leszek Swirski

                    Code-Review+1

                    1 comment

                    Patchset-level comments
                    Emmanuel Romero Ruiz . resolved

                    @jbr...@chromium.org @les...@chromium.org I wait for you look in the latest changes

                    Leszek Swirski

                    still lgtm

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Emmanuel Romero Ruiz
                    • Jeremy Roman
                    Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Gerrit-Comment-Date: Tue, 27 Jan 2026 10:52:43 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes
                    Comment-In-Reply-To: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    satisfied_requirement
                    open
                    diffy

                    Jeremy Roman (Gerrit)

                    unread,
                    Jan 27, 2026, 1:14:28 PMJan 27
                    to Emmanuel Romero Ruiz, Jeremy Roman, Leszek Swirski, Justin Lulejian, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
                    Attention needed from Emmanuel Romero Ruiz

                    Jeremy Roman voted Code-Review+1

                    Code-Review+1
                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Emmanuel Romero Ruiz
                    Gerrit-Attention: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Gerrit-Comment-Date: Tue, 27 Jan 2026 18:14:17 +0000
                    Gerrit-HasComments: No
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    open
                    diffy

                    Emmanuel Romero Ruiz (Gerrit)

                    unread,
                    Jan 27, 2026, 1:15:30 PMJan 27
                    to Jeremy Roman, Leszek Swirski, Justin Lulejian, Devlin Cronin, Chromium LUCI CQ, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

                    Emmanuel Romero Ruiz voted Commit-Queue+2

                    Commit-Queue+2
                    Open in Gerrit

                    Related details

                    Attention set is empty
                    Gerrit-Comment-Date: Tue, 27 Jan 2026 18:15:18 +0000
                    Gerrit-HasComments: No
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    open
                    diffy

                    Chromium LUCI CQ (Gerrit)

                    unread,
                    Jan 27, 2026, 4:16:42 PMJan 27
                    to Emmanuel Romero Ruiz, Jeremy Roman, Leszek Swirski, Justin Lulejian, Devlin Cronin, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

                    Chromium LUCI CQ submitted the change

                    Change information

                    Commit message:
                    Background compile JS extension scripts injected at document start

                    Re open for the CL
                    https://chromium-review.googlesource.com/c/chromium/src/+/6820371

                    Currently, parsing/compiling of JS scripts injected by extensions to run
                    at document start is performed in the main thread, affecting the
                    performance of all pages. This could be improved by starting the
                    compilation in the background thread earlier in the compilation process.
                    This CL makes changes to extensions/ and blink/ to make this happen:

                    Extensions:
                    - Add logic to ExtensionFrameHelper::ReadyToCommitNavigation to start
                    the background compilation.
                    - Add logic to ScriptInjection::InjectJs to add the streamer to the
                    corresponding blink::WebScriptSource objects.

                    Blink
                    - Add a public ExtensionScriptStreamer so that extensions can start
                    the streaming and blink::WebScriptSource can hold a reference to
                    blink::BackgroundInlineScriptStreamer.
                    - Modify blink::ClassicScript::CreateUnspecifiedScript to accept a
                    ScriptStreamer argument.
                    Bug: 436274244
                    Change-Id: I5b0237406552297b7007a43357cbc6ff19e339b1
                    Commit-Queue: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Reviewed-by: Leszek Swirski <les...@chromium.org>
                    Reviewed-by: Devlin Cronin <rdevlin...@chromium.org>
                    Reviewed-by: Justin Lulejian <jlul...@chromium.org>
                    Reviewed-by: Jeremy Roman <jbr...@chromium.org>
                    Cr-Commit-Position: refs/heads/main@{#1575481}
                    Files:
                    • M chrome/browser/extensions/content_script_apitest.cc
                    • M extensions/common/extension_features.cc
                    • M extensions/common/extension_features.h
                    • M extensions/renderer/dispatcher.h
                    • M extensions/renderer/extension_frame_helper.cc
                    • M extensions/renderer/extension_frame_helper.h
                    • M extensions/renderer/programmatic_script_injector.cc
                    • M extensions/renderer/programmatic_script_injector.h
                    • M extensions/renderer/script_injection.cc
                    • M extensions/renderer/script_injection_manager.cc
                    • M extensions/renderer/script_injection_manager.h
                    • M extensions/renderer/script_injector.h
                    • M extensions/renderer/user_script_injector.cc
                    • M extensions/renderer/user_script_injector.h
                    • M extensions/renderer/user_script_set.cc
                    • M extensions/renderer/user_script_set.h
                    • M extensions/renderer/user_script_set_manager.cc
                    • M extensions/renderer/user_script_set_manager.h
                    • M third_party/blink/public/BUILD.gn
                    • A third_party/blink/public/web/extension_script_streamer.h
                    • M third_party/blink/public/web/web_script_source.h
                    • M third_party/blink/renderer/bindings/core/v8/script_streamer.cc
                    • M third_party/blink/renderer/bindings/core/v8/script_streamer.h
                    • M third_party/blink/renderer/bindings/core/v8/script_streamer_test.cc
                    • M third_party/blink/renderer/core/exported/build.gni
                    • A third_party/blink/renderer/core/exported/extension_script_streamer.cc
                    • A third_party/blink/renderer/core/exported/extension_script_streamer_test.cc
                    • M third_party/blink/renderer/core/frame/pausable_script_executor.cc
                    • M third_party/blink/renderer/core/html/parser/background_html_scanner.cc
                    • M third_party/blink/renderer/core/html/parser/background_html_scanner_test.cc
                    • M third_party/blink/renderer/core/script/classic_script.cc
                    • M third_party/blink/renderer/core/script/classic_script.h
                    • M tools/metrics/histograms/metadata/extensions/histograms.xml
                    Change size: XL
                    Delta: 33 files changed, 1166 insertions(+), 50 deletions(-)
                    Branch: refs/heads/main
                    Submit Requirements:
                    • requirement satisfiedCode-Review: +1 by Justin Lulejian, +1 by Jeremy Roman, +1 by Devlin Cronin, +1 by Leszek Swirski
                    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: I5b0237406552297b7007a43357cbc6ff19e339b1
                    Gerrit-Change-Number: 7404059
                    Gerrit-PatchSet: 12
                    Gerrit-Owner: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
                    Gerrit-Reviewer: Emmanuel Romero Ruiz <emro...@microsoft.com>
                    Gerrit-Reviewer: Jeremy Roman <jbr...@chromium.org>
                    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
                    Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
                    open
                    diffy
                    satisfied_requirement
                    Reply all
                    Reply to author
                    Forward
                    0 new messages