remoting: Extract input filters into InputPipeline [chromium/src : main]

0 views
Skip to first unread message

Yuwei Huang (Gerrit)

unread,
Jun 11, 2026, 7:52:49 PMJun 11
to chromium...@chromium.org, chromotin...@chromium.org

Yuwei Huang added 4 comments

File remoting/host/client_session.cc
Line 179, Patchset 1 (Latest): // Prevent dangling pointer in input_pipeline_ if input_injector_ is still
Yuwei Huang . unresolved

Wrap these with ``` `` ```.

Line 181, Patchset 1 (Latest): input_pipeline_.SetTarget(nullptr);
Yuwei Huang . unresolved

This awkward line can be avoided if you move `input_pipeline_` after `input_injector_`.

Line 787, Patchset 1 (Latest): // Avoid dangling raw_ptr in `input_tracker_` after deleting
Yuwei Huang . unresolved

Since you are now calling `input_pipeline_.SetTarget(nullptr);` instead of `input_tracker_.set_input_stub(nullptr);`, consider updating this comment to refer to `input_pipeline_` for consistency (e.g., "Avoid dangling raw_ptr in `input_pipeline_`...").

File remoting/host/input_pipeline.h
Line 56, Patchset 1 (Latest): protocol::FractionalInputFilter* fractional_input_filter() {
Yuwei Huang . unresolved

Unlike the other accessors, `fractional_input_filter()` doesn't appear to be used anywhere in `ClientSession` (since it is configured internally using the `CoordinateConverter` passed to the constructor). Feel free to remove it for better encapsulation if it's not needed.

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: Id5b615e876861fbf7ecdf8b1a54deeb74f70c034
Gerrit-Change-Number: 7926585
Gerrit-PatchSet: 1
Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
Gerrit-Comment-Date: Thu, 11 Jun 2026 23:52:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Jun 11, 2026, 8:07:13 PMJun 11
to chromium...@chromium.org, chromotin...@chromium.org

Yuwei Huang added 4 comments

File remoting/host/client_session.cc
Line 179, Patchset 1: // Prevent dangling pointer in input_pipeline_ if input_injector_ is still
Yuwei Huang . resolved

Wrap these with ``` `` ```.

Yuwei Huang

Done

Line 181, Patchset 1: input_pipeline_.SetTarget(nullptr);
Yuwei Huang . resolved

This awkward line can be avoided if you move `input_pipeline_` after `input_injector_`.

Yuwei Huang

Done

Line 787, Patchset 1: // Avoid dangling raw_ptr in `input_tracker_` after deleting
Yuwei Huang . resolved

Since you are now calling `input_pipeline_.SetTarget(nullptr);` instead of `input_tracker_.set_input_stub(nullptr);`, consider updating this comment to refer to `input_pipeline_` for consistency (e.g., "Avoid dangling raw_ptr in `input_pipeline_`...").

Yuwei Huang

Done

File remoting/host/input_pipeline.h
Line 56, Patchset 1: protocol::FractionalInputFilter* fractional_input_filter() {
Yuwei Huang . resolved

Unlike the other accessors, `fractional_input_filter()` doesn't appear to be used anywhere in `ClientSession` (since it is configured internally using the `CoordinateConverter` passed to the constructor). Feel free to remove it for better encapsulation if it's not needed.

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: Id5b615e876861fbf7ecdf8b1a54deeb74f70c034
    Gerrit-Change-Number: 7926585
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Comment-Date: Fri, 12 Jun 2026 00:06:42 +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,
    Jun 11, 2026, 8:07:56 PMJun 11
    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

    Commit-Queue+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 2 (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: Id5b615e876861fbf7ecdf8b1a54deeb74f70c034
    Gerrit-Change-Number: 7926585
    Gerrit-PatchSet: 2
    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: Fri, 12 Jun 2026 00:07:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joe Downing (Gerrit)

    unread,
    Jun 15, 2026, 9:07:23 PM (13 days ago) Jun 15
    to Yuwei Huang, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
    Attention needed from Yuwei Huang

    Joe Downing voted and added 4 comments

    Votes added by Joe Downing

    Code-Review+1

    4 comments

    Patchset-level comments
    Joe Downing . resolved

    lgtm with a couple of questions/suggestions.

    File remoting/host/client_session.h
    Line 389, Patchset 2 (Latest): // Declared after input_injector_ because it holds a reference to it (via
    Joe Downing . unresolved

    nit: |input_injector_|

    File remoting/host/input_pipeline.h
    Line 46, Patchset 2 (Latest): // Accessors for configuring or observing specific filters in the chain.
    Joe Downing . unresolved

    I like the idea of encapsulating the input pipeline since it is so error-prone and complicated and it's nice to have something that is more testable but I think exposing the individual filters does not take advantage of this encapsulation.

    Ideally the InputPipeline would provide methods directly, rather than accessors. Also it would be great to see some InputPipeline tests added.

    I don't feel too strongly since this is a yak-shaving CL so feel free to ack but I think this would be a nice improvement in a follow-up.

    Line 44, Patchset 2 (Latest): void SetTarget(protocol::InputStub* target);
    Joe Downing . unresolved

    Why change the name of the method and arg to 'target'? IMO using 'SetInputStub' would be clearer and is easier to search for. Target is generic and makes me think of DOM events.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yuwei Huang
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: Id5b615e876861fbf7ecdf8b1a54deeb74f70c034
      Gerrit-Change-Number: 7926585
      Gerrit-PatchSet: 2
      Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Comment-Date: Tue, 16 Jun 2026 01:07:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yuwei Huang (Gerrit)

      unread,
      Jun 18, 2026, 7:21:09 PM (10 days ago) Jun 18
      to Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org

      Yuwei Huang voted and added 4 comments

      Votes added by Yuwei Huang

      Commit-Queue+2

      4 comments

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

      Thanks!

      File remoting/host/client_session.h
      Line 389, Patchset 2: // Declared after input_injector_ because it holds a reference to it (via
      Joe Downing . resolved

      nit: |input_injector_|

      Yuwei Huang

      Done, using ``` `` ```.

      File remoting/host/input_pipeline.h
      Line 46, Patchset 2: // Accessors for configuring or observing specific filters in the chain.
      Joe Downing . resolved

      I like the idea of encapsulating the input pipeline since it is so error-prone and complicated and it's nice to have something that is more testable but I think exposing the individual filters does not take advantage of this encapsulation.

      Ideally the InputPipeline would provide methods directly, rather than accessors. Also it would be great to see some InputPipeline tests added.

      I don't feel too strongly since this is a yak-shaving CL so feel free to ack but I think this would be a nice improvement in a follow-up.

      Yuwei Huang

      Acknowledged. We will do it in a follow-up CL.

      Line 44, Patchset 2: void SetTarget(protocol::InputStub* target);
      Joe Downing . resolved

      Why change the name of the method and arg to 'target'? IMO using 'SetInputStub' would be clearer and is easier to search for. Target is generic and makes me think of DOM events.

      Yuwei Huang

      I didn't do it because `InputPipeline` itself is an `InputStub` which feels confusing, but given `InputFilter` already has `set_input_filter`, I think this is fine. Done.

      Open in Gerrit

      Related details

      Attention set is empty
      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: Id5b615e876861fbf7ecdf8b1a54deeb74f70c034
        Gerrit-Change-Number: 7926585
        Gerrit-PatchSet: 5
        Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
        Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
        Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
        Gerrit-Comment-Date: Thu, 18 Jun 2026 23:20:48 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Joe Downing <joe...@chromium.org>
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Jun 18, 2026, 8:04:57 PM (10 days ago) Jun 18
        to Yuwei Huang, Joe Downing, chromium...@chromium.org, chromotin...@chromium.org

        Chromium LUCI CQ submitted the change with unreviewed changes

        Unreviewed changes

        2 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: remoting/host/client_session.h
        Insertions: 1, Deletions: 1.

        The diff is too large to show. Please review the diff.
        ```
        ```
        The name of the file: remoting/host/input_pipeline.cc
        Insertions: 2, Deletions: 2.

        The diff is too large to show. Please review the diff.
        ```
        ```
        The name of the file: remoting/host/input_pipeline.h
        Insertions: 3, Deletions: 2.

        The diff is too large to show. Please review the diff.
        ```
        ```
        The name of the file: remoting/host/client_session.cc
        Insertions: 2, Deletions: 2.

        The diff is too large to show. Please review the diff.
        ```

        Change information

        Commit message:
        remoting: Extract input filters into InputPipeline

        This CL refactors ClientSession to encapsulate its 7 individual input
        filters into a new dedicated class, InputPipeline.

        Why this is needed:
        This is a preparatory refactoring for the dedicated Peer Connection
        (PC) process architecture. To support running WebRTC in a sandboxed
        process, we will move WebRTC connection and input injection logic
        from ClientSession (Network process) to PeerSessionImpl (PC process).

        Currently, ClientSession manages and chains these 7 filters manually.
        Extracting them into a self-contained InputPipeline class simplifies
        ClientSession and makes the input path modular. This allows us to
        easily move the entire input pipeline to PeerSessionImpl in a
        subsequent CL, keeping the multi-process integration CLs small and
        reviewable.

        This CL also improves code health by isolating the input path and
        making the lifetime safety requirements (reverse-declaration order)
        explicit.

        TAG=agy
        CONV=bf005916-ada6-4139-af52-be0884b5cbf0
        Bug: 502281489
        Change-Id: Id5b615e876861fbf7ecdf8b1a54deeb74f70c034
        Commit-Queue: Yuwei Huang <yuw...@chromium.org>
        Reviewed-by: Joe Downing <joe...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1649404}
        Files:
        • M remoting/host/BUILD.gn
        • M remoting/host/client_session.cc
        • M remoting/host/client_session.h
        • A remoting/host/input_pipeline.cc
        • A remoting/host/input_pipeline.h
        Change size: L
        Delta: 5 files changed, 197 insertions(+), 68 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Joe Downing
        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: Id5b615e876861fbf7ecdf8b1a54deeb74f70c034
        Gerrit-Change-Number: 7926585
        Gerrit-PatchSet: 6
        Gerrit-Owner: Yuwei Huang <yuw...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
        Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages