[remoting][linux] Fix racey SetSharedMemoryFactory [chromium/src : main]

0 views
Skip to first unread message

Yuwei Huang (Gerrit)

unread,
5:30 PM (1 hour ago) 5:30 PM
to chromium...@chromium.org, chromotin...@chromium.org

Yuwei Huang added 2 comments

File remoting/host/linux/pipewire_capture_stream.cc
Line 199, Patchset 3 (Latest): video_capture_started_ = false;
Yuwei Huang . unresolved

When stopping the capture stream, we should also reset `is_capturing_frame_ = false;`.

Otherwise, if we stop the stream while a frame is in the middle of being captured, `is_capturing_frame_` will remain `true` and carry over to the next generation, preventing `RecaptureLatestFrameAsDirty` from working properly until the next generation finishes capturing its first frame.

Line 357, Patchset 3 (Latest): is_capturing_frame_ = false;
Yuwei Huang . unresolved

If a delayed `OnCaptureResult` from a previous generation runs while the current generation is capturing a frame, it will prematurely clear `is_capturing_frame_`. This can cause subsequent calls to `RecaptureLatestFrameAsDirty` to incorrectly execute synchronous captures because they think no frame capture is in progress.

`is_capturing_frame_ = false;` should be moved after the generation check below.

Open in Gerrit

Related details

Attention set is empty
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: I2cc2ad7ce2b6065c48de1e8248a74694488021cd
Gerrit-Change-Number: 7870040
Gerrit-PatchSet: 3
Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
Gerrit-Comment-Date: Thu, 21 May 2026 21:30:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
5:47 PM (1 hour ago) 5:47 PM
to chromium...@chromium.org, chromotin...@chromium.org

Yuwei Huang added 2 comments

File remoting/host/linux/pipewire_capture_stream.cc
Line 199, Patchset 3: video_capture_started_ = false;
Yuwei Huang . resolved

When stopping the capture stream, we should also reset `is_capturing_frame_ = false;`.

Otherwise, if we stop the stream while a frame is in the middle of being captured, `is_capturing_frame_` will remain `true` and carry over to the next generation, preventing `RecaptureLatestFrameAsDirty` from working properly until the next generation finishes capturing its first frame.

Yuwei Huang

Done

Line 357, Patchset 3: is_capturing_frame_ = false;
Yuwei Huang . resolved

If a delayed `OnCaptureResult` from a previous generation runs while the current generation is capturing a frame, it will prematurely clear `is_capturing_frame_`. This can cause subsequent calls to `RecaptureLatestFrameAsDirty` to incorrectly execute synchronous captures because they think no frame capture is in progress.

`is_capturing_frame_ = false;` should be moved after the generation check below.

Yuwei Huang

Done

Open in Gerrit

Related details

Attention set is empty
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: I2cc2ad7ce2b6065c48de1e8248a74694488021cd
    Gerrit-Change-Number: 7870040
    Gerrit-PatchSet: 4
    Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Comment-Date: Thu, 21 May 2026 21:47:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuwei Huang (Gerrit)

    unread,
    5:48 PM (1 hour ago) 5:48 PM
    to Joe Downing, chromium...@chromium.org, chromotin...@chromium.org
    Attention needed from Joe Downing

    Yuwei Huang voted and added 1 comment

    Votes added by Yuwei Huang

    Auto-Submit+1
    Commit-Queue+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 4 (Latest):
    Yuwei Huang . resolved

    PTAL thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joe Downing
    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: I2cc2ad7ce2b6065c48de1e8248a74694488021cd
    Gerrit-Change-Number: 7870040
    Gerrit-PatchSet: 4
    Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Joe Downing <joe...@chromium.org>
    Gerrit-Comment-Date: Thu, 21 May 2026 21:47:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages