[task] Use message pump in InProcessRendererThread [chromium/src : main]

0 views
Skip to first unread message

Etienne Pierre-Doray (Gerrit)

unread,
Mar 25, 2026, 7:14:36 AM (8 days ago) Mar 25
to AyeAye, Alexander Timin, Gabriel Charette, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, scheduler-...@chromium.org, chikamu...@chromium.org
Attention needed from Alexander Timin and Gabriel Charette

Etienne Pierre-Doray added 6 comments

Patchset-level comments
File-level comment, Patchset 33 (Latest):
Etienne Pierre-Doray . resolved

PTAnL?

Commit Message
Line 9, Patchset 18:This removes the only usage of ThreadControllerImpl in prod(-ish). This
Gabriel Charette . resolved

I don't see any ThreadControllerImpl usage changing in this CL? Is this now just the precursor API CL?

Etienne Pierre-Doray

This is removing the implicit creation of ThreadControllerImpl here
https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/in_process_renderer_thread.cc;l=44?q=InProcessRendererThread::Init&ss=chromium

But I guess it only becomes obvious in the follow up where this is made more explicit in CreateMainThreadSchedulerForTesting()

Gabriel Charette

I see, let's clarify in CL description?

Etienne Pierre-Doray

Done

File base/threading/thread.h
Line 124, Patchset 19: bool restartable = false,
Alexander Timin . resolved

I'm a big fan for using enum classes for things like this one :).

Etienne Pierre-Doray

Acknowledged (done in precursor)

Line 123, Patchset 19: explicit Thread(const std::string& name,
Alexander Timin . resolved

Could we add a comment here about |restartable| and |delegate| being mutually exclusive (and ideally why)?

(also some description of what |restartable| is and why it's needed in general would be welcome)

Etienne Pierre-Doray

Acknowledged (done in precursor)

File content/browser/browser_process_io_thread.cc
Line 45, Patchset 19: false,
Alexander Timin . resolved

nit: /*restartable=*/ (or enum class).

Etienne Pierre-Doray

Acknowledged

File content/renderer/in_process_renderer_thread.cc
Line 81, Patchset 19: base::MessagePump::Create(base::MessagePumpType::DEFAULT));
Gabriel Charette . resolved

Let's `DCHECK(base::ThreadTaskRunnerHandle::IsSet());` and `DCHECK(base::CurrentThread::IsSet());` after this call with a comment that says:

// Make sure the contract of Thread::Delegate::BindToCurrentThread() is fulfilled.

(it's non-obvious to me from this that it is though I can see how deep down this call it's probably happening; saw some code but also some conditionals...)

Etienne Pierre-Doray

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Timin
  • Gabriel Charette
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: I69911127b7caab5cecb50de88ae78153cf8af3f3
Gerrit-Change-Number: 3399727
Gerrit-PatchSet: 33
Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Alexander Timin <alt...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Gabriel Charette <g...@chromium.org>
Gerrit-CC: Name of user not set #1242319
Gerrit-Attention: Gabriel Charette <g...@chromium.org>
Gerrit-Attention: Alexander Timin <alt...@chromium.org>
Gerrit-Comment-Date: Wed, 25 Mar 2026 11:14:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Gabriel Charette <g...@chromium.org>
Comment-In-Reply-To: Alexander Timin <alt...@chromium.org>
Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Gabriel Charette (Gerrit)

unread,
Mar 27, 2026, 3:48:10 PM (6 days ago) Mar 27
to Etienne Pierre-Doray, Gabriel Charette, AyeAye, Alexander Timin, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, scheduler-...@chromium.org, chikamu...@chromium.org
Attention needed from Alexander Timin and Etienne Pierre-Doray

Gabriel Charette voted and added 3 comments

Votes added by Gabriel Charette

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 35 (Latest):
Gabriel Charette . resolved

I think this LGTM

Commit Message
Line 9, Patchset 35 (Latest):This removes the only usage of ThreadControllerImpl in prod(-ish)
Gabriel Charette . unresolved

Let's clarify that this is by removing the last call to CreateMainThreadScheduler w/o a MessagePump?

File third_party/blink/renderer/platform/scheduler/common/web_thread_scheduler.cc
Line 37, Patchset 35 (Latest): .SetShouldReportLockMetrics(is_main_thread)
Gabriel Charette . unresolved

Why this change? Explain in CL desc why that's related?

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Timin
  • Etienne Pierre-Doray
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: I69911127b7caab5cecb50de88ae78153cf8af3f3
    Gerrit-Change-Number: 3399727
    Gerrit-PatchSet: 35
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Alexander Timin <alt...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Gabriel Charette <g...@chromium.org>
    Gerrit-CC: Name of user not set #1242319
    Gerrit-Attention: Alexander Timin <alt...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Fri, 27 Mar 2026 19:48:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    10:55 AM (4 hours ago) 10:55 AM
    to Daniel Cheng, Alexander Timin, Gabriel Charette, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, chrome-intelligence-te...@google.com, chrome-intell...@chromium.org, penghuan...@chromium.org, cblume...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, scheduler-...@chromium.org, chikamu...@chromium.org
    Attention needed from Alexander Timin, Daniel Cheng and Gabriel Charette

    Etienne Pierre-Doray added 4 comments

    Patchset-level comments
    File-level comment, Patchset 42 (Latest):
    Etienne Pierre-Doray . resolved

    +dcheng@ for content/renderer/

    Commit Message
    Line 9, Patchset 35:This removes the only usage of ThreadControllerImpl in prod(-ish)
    Gabriel Charette . resolved

    Let's clarify that this is by removing the last call to CreateMainThreadScheduler w/o a MessagePump?

    Etienne Pierre-Doray

    Done

    File content/renderer/in_process_renderer_thread.cc
    Line 66, Patchset 18:void InProcessRendererThread::ThreadDelegate::BindToCurrentThread(
    Gabriel Charette . resolved

    Seems this should still call the underlying Delegate::BindToCurrentThread()?

    But overall I don't see why we need to do this here instead of in Init() I'm surprised BindToCurrentThread us overridable at all, seems like a second way of handling Init? Document the difference if it is indeed needed?

    Etienne Pierre-Doray

    This overrides a pure virtual class (we completely bypass the default SequenceManagerThreadDelegate)
    From base::Thread impl, BindToCurrentThread is called earlier and is expected to create the scheduling environment (DCHECK(ThreadTaskRunnerHandle::IsSet()))
    We're using this to create our own SequenceManager (via CreateMainThreadScheduler); doing it in Init would be too late.

    https://source.chromium.org/chromium/chromium/src/+/main:base/threading/thread.cc;l=370;bpv=1;bpt=1

    Etienne Pierre-Doray

    Acknowledged

    File third_party/blink/renderer/platform/scheduler/common/web_thread_scheduler.cc
    Line 37, Patchset 35: .SetShouldReportLockMetrics(is_main_thread)
    Gabriel Charette . resolved

    Why this change? Explain in CL desc why that's related?

    Etienne Pierre-Doray

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexander Timin
    • Daniel Cheng
    • Gabriel Charette
    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: I69911127b7caab5cecb50de88ae78153cf8af3f3
      Gerrit-Change-Number: 3399727
      Gerrit-PatchSet: 42
      Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
      Gerrit-Reviewer: Gabriel Charette <g...@chromium.org>
      Gerrit-CC: Alexander Timin <alt...@chromium.org>
      Gerrit-CC: Name of user not set #1242319
      Gerrit-Attention: Gabriel Charette <g...@chromium.org>
      Gerrit-Attention: Alexander Timin <alt...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 14:55:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gabriel Charette <g...@chromium.org>
      Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages