[cleanup] Express CommitPending in terms of BMFIdle [chromium/src : main]

0 views
Skip to first unread message

Stacy Gaikovaia (Gerrit)

unread,
Mar 23, 2026, 10:23:36 PM (10 days ago) Mar 23
to Jonathan Ross, chromium...@chromium.org, cc-...@chromium.org, schedule...@chromium.org
Attention needed from Jonathan Ross

Stacy Gaikovaia has uploaded the change for review

Stacy Gaikovaia would like Jonathan Ross to review this change.

Commit message

[cleanup] Express CommitPending in terms of BMFIdle

This makes it slightly easier to see all the uses of
begin_main_frame_state_ inside the state machine.

R=jonross
Bug: 466435671
Change-Id: I6f7b4d2ad89d9e0c53a780c2694443eae11ab7b0

Change diff

diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 3f9bd040..60dfcb2 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -1002,7 +1002,7 @@
// OnBeginImplFrameIdle for cases where the scheduler aborts draws outside
// of the deadline.
main_thread_missed_last_deadline_ =
- CommitPending() ||
+ !BeginMainFrameStateIdle(begin_main_frame_state_) ||
(has_pending_tree_ && !current_pending_tree_is_impl_side_);

// We need to reset needs_redraw_ before we draw since the
@@ -1304,7 +1304,8 @@
// If a new or undrawn active tree is pending after the deadline,
// then the main thread is in a high latency mode.
main_thread_missed_last_deadline_ =
- CommitPending() || has_pending_tree_ || active_tree_needs_first_draw_;
+ !BeginMainFrameStateIdle(begin_main_frame_state_) || has_pending_tree_ ||
+ active_tree_needs_first_draw_;

// If we're entering a state where we won't get BeginFrames set all the
// funnels so that we don't perform any actions that we shouldn't.
@@ -1388,7 +1389,8 @@

// We did not send a BeginMainFrame() and main is not busy, we can trigger the
// deadline immediately.
- bool wait_for_main = CommitPending() || has_pending_tree_;
+ bool wait_for_main =
+ !BeginMainFrameStateIdle(begin_main_frame_state_) || has_pending_tree_;
if (last_begin_impl_frame_time_ != last_sent_begin_main_frame_time_ &&
!wait_for_main) {
TRACE_EVENT_INSTANT("cc", "TriggerDeadlineDueToThrottling");
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 94e7845..f12f36c 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -122,7 +122,7 @@
}

bool CommitPending() const {
- return begin_main_frame_state_ != BeginMainFrameState::IDLE;
+ return !BeginMainFrameStateIdle(begin_main_frame_state_);
}

bool NewActiveTreeLikely() const {

Change information

Files:
  • M cc/scheduler/scheduler_state_machine.cc
  • M cc/scheduler/scheduler_state_machine.h
Change size: S
Delta: 2 files changed, 6 insertions(+), 4 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Jonathan Ross
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: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6f7b4d2ad89d9e0c53a780c2694443eae11ab7b0
Gerrit-Change-Number: 7695070
Gerrit-PatchSet: 1
Gerrit-Owner: Stacy Gaikovaia <ga...@google.com>
Gerrit-Reviewer: Jonathan Ross <jon...@chromium.org>
Gerrit-Reviewer: Stacy Gaikovaia <ga...@google.com>
Gerrit-Attention: Jonathan Ross <jon...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Jonathan Ross (Gerrit)

unread,
Mar 25, 2026, 10:40:21 AM (8 days ago) Mar 25
to Stacy Gaikovaia, Chromium LUCI CQ, chromium...@chromium.org, cc-...@chromium.org, schedule...@chromium.org
Attention needed from Stacy Gaikovaia

Jonathan Ross added 1 comment

File cc/scheduler/scheduler_state_machine.h
Line 124, Patchset 1 (Latest): bool CommitPending() const {
Jonathan Ross . unresolved

Do we need this anymore if we are updating the callsites too?

Open in Gerrit

Related details

Attention is currently required from:
  • Stacy Gaikovaia
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I6f7b4d2ad89d9e0c53a780c2694443eae11ab7b0
    Gerrit-Change-Number: 7695070
    Gerrit-PatchSet: 1
    Gerrit-Owner: Stacy Gaikovaia <ga...@google.com>
    Gerrit-Reviewer: Jonathan Ross <jon...@chromium.org>
    Gerrit-Reviewer: Stacy Gaikovaia <ga...@google.com>
    Gerrit-Attention: Stacy Gaikovaia <ga...@google.com>
    Gerrit-Comment-Date: Wed, 25 Mar 2026 14:40:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages