gpu: In-browser-process mode for zero-copy video capture [chromium/src : main]

1 view
Skip to first unread message

Sean Li (Gerrit)

unread,
Jul 7, 2026, 1:54:28 AMJul 7
to Eugene Zemtsov, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
Attention needed from Eugene Zemtsov and Vasiliy Telezhnikov

Sean Li added 2 comments

File content/browser/video_capture_service_impl.cc
Line 67, Patchset 2 (Latest):class InProcessVideoCaptureGpuContextProvider final
Sean Li . unresolved

IIUC, `InProcessVideoCaptureGpuContextProvider` should handle `gpu_workarounds`.

Line 168, Patchset 2 (Latest): std::unique_ptr<InProcessVideoCaptureGpuContextProvider>>
Sean Li . unresolved

The establishment of GPU channel in browser is async. If the establishment of GPU channel is after [HW buffer submit](https://source.chromium.org/chromium/chromium/src/+/main:media/capture/video/android/video_capture_device_android.cc;l=472-479;drc=c1b41d1ecd522fa07dd2fb895abefed65084da6d) or GPU channel is lost during VCD streaming, it will break VCD.

We should have a mechanism to recover instead of returning error in VCD.

Open in Gerrit

Related details

Attention is currently required from:
  • Eugene Zemtsov
  • Vasiliy Telezhnikov
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: Ic4709675749deeee32088e336cccb6a53e460ca0
Gerrit-Change-Number: 8029420
Gerrit-PatchSet: 2
Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Reviewer: Sean Li <sea...@google.com>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Tue, 07 Jul 2026 05:53:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sean Li (Gerrit)

unread,
Jul 7, 2026, 1:56:26 AMJul 7
to Eugene Zemtsov, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
Attention needed from Eugene Zemtsov and Vasiliy Telezhnikov

Sean Li added 1 comment

File content/browser/video_capture_service_impl.cc
Line 67, Patchset 2 (Latest):class InProcessVideoCaptureGpuContextProvider final
Sean Li . unresolved

IIUC, `InProcessVideoCaptureGpuContextProvider` should handle `gpu_workarounds`.

Sean Li

And `gpu_workarounds` should be always ready before VCD is created and starts.

Gerrit-Comment-Date: Tue, 07 Jul 2026 05:56:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sean Li <sea...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Eugene Zemtsov (Gerrit)

unread,
Jul 14, 2026, 1:59:04 PMJul 14
to Eugene Zemtsov, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
Attention needed from Sean Li and Vasiliy Telezhnikov

Eugene Zemtsov voted and added 2 comments

Votes added by Eugene Zemtsov

Commit-Queue+1

2 comments

File content/browser/video_capture_service_impl.cc
Line 67, Patchset 2:class InProcessVideoCaptureGpuContextProvider final
Sean Li . resolved

IIUC, `InProcessVideoCaptureGpuContextProvider` should handle `gpu_workarounds`.

Sean Li

And `gpu_workarounds` should be always ready before VCD is created and starts.

Eugene Zemtsov

Done

Line 168, Patchset 2: std::unique_ptr<InProcessVideoCaptureGpuContextProvider>>
Sean Li . resolved

The establishment of GPU channel in browser is async. If the establishment of GPU channel is after [HW buffer submit](https://source.chromium.org/chromium/chromium/src/+/main:media/capture/video/android/video_capture_device_android.cc;l=472-479;drc=c1b41d1ecd522fa07dd2fb895abefed65084da6d) or GPU channel is lost during VCD streaming, it will break VCD.

We should have a mechanism to recover instead of returning error in VCD.

Eugene Zemtsov

Done. Recovery works now after GPU crash.

Open in Gerrit

Related details

Attention is currently required from:
  • Sean Li
  • Vasiliy Telezhnikov
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: Ic4709675749deeee32088e336cccb6a53e460ca0
    Gerrit-Change-Number: 8029420
    Gerrit-PatchSet: 6
    Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
    Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
    Gerrit-Reviewer: Sean Li <sea...@google.com>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
    Gerrit-Attention: Sean Li <sea...@google.com>
    Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-Comment-Date: Tue, 14 Jul 2026 17:58:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Sean Li <sea...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Vasiliy Telezhnikov (Gerrit)

    unread,
    Jul 14, 2026, 4:48:17 PMJul 14
    to Eugene Zemtsov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
    Attention needed from Eugene Zemtsov and Sean Li

    Vasiliy Telezhnikov added 1 comment

    File gpu/vulkan/vulkan_instance.cc
    Line 75, Patchset 7 (Latest):std::atomic<bool>& GetIsFromAngleGlobal() {
    Vasiliy Telezhnikov . unresolved

    Instead of doing this and adding silent fallback from VulkanFromAngle to native, could we make a way (e.g by passing arg to ctor) to force it always use native ignoring the feature flag?

    Silent fallback has quite a bit side-effects in terms of what configuration we run on which devices and it's already too complicated.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Eugene Zemtsov
    • Sean Li
    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: Ic4709675749deeee32088e336cccb6a53e460ca0
      Gerrit-Change-Number: 8029420
      Gerrit-PatchSet: 7
      Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
      Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
      Gerrit-Reviewer: Sean Li <sea...@google.com>
      Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
      Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
      Gerrit-Attention: Sean Li <sea...@google.com>
      Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
      Gerrit-Comment-Date: Tue, 14 Jul 2026 20:48:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Eugene Zemtsov (Gerrit)

      unread,
      Jul 14, 2026, 9:28:09 PMJul 14
      to Eugene Zemtsov, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
      Attention needed from Sean Li and Vasiliy Telezhnikov

      Eugene Zemtsov added 1 comment

      File gpu/vulkan/vulkan_instance.cc
      Line 75, Patchset 7:std::atomic<bool>& GetIsFromAngleGlobal() {
      Vasiliy Telezhnikov . resolved

      Instead of doing this and adding silent fallback from VulkanFromAngle to native, could we make a way (e.g by passing arg to ctor) to force it always use native ignoring the feature flag?

      Silent fallback has quite a bit side-effects in terms of what configuration we run on which devices and it's already too complicated.

      Eugene Zemtsov

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Sean Li
      • Vasiliy Telezhnikov
      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: Ic4709675749deeee32088e336cccb6a53e460ca0
        Gerrit-Change-Number: 8029420
        Gerrit-PatchSet: 8
        Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
        Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
        Gerrit-Reviewer: Sean Li <sea...@google.com>
        Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
        Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
        Gerrit-Attention: Sean Li <sea...@google.com>
        Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
        Gerrit-Comment-Date: Wed, 15 Jul 2026 01:27:53 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Vasiliy Telezhnikov <vas...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Vasiliy Telezhnikov (Gerrit)

        unread,
        Jul 15, 2026, 1:18:04 PMJul 15
        to Eugene Zemtsov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
        Attention needed from Eugene Zemtsov and Sean Li

        Vasiliy Telezhnikov voted and added 1 comment

        Votes added by Vasiliy Telezhnikov

        Code-Review+1

        1 comment

        Patchset-level comments
        File-level comment, Patchset 8 (Latest):
        Vasiliy Telezhnikov . resolved

        lgtm, thanks.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Eugene Zemtsov
        • Sean Li
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not 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: Ic4709675749deeee32088e336cccb6a53e460ca0
          Gerrit-Change-Number: 8029420
          Gerrit-PatchSet: 8
          Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Reviewer: Sean Li <sea...@google.com>
          Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
          Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
          Gerrit-Attention: Sean Li <sea...@google.com>
          Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Comment-Date: Wed, 15 Jul 2026 17:17:52 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Dave Tapuska (Gerrit)

          unread,
          Jul 15, 2026, 5:28:48 PMJul 15
          to Eugene Zemtsov, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
          Attention needed from Eugene Zemtsov, Markus Handell and Sean Li

          Dave Tapuska voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Eugene Zemtsov
          • Markus Handell
          • Sean Li
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not 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: Ic4709675749deeee32088e336cccb6a53e460ca0
          Gerrit-Change-Number: 8029420
          Gerrit-PatchSet: 8
          Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Reviewer: Markus Handell <hand...@google.com>
          Gerrit-Reviewer: Sean Li <sea...@google.com>
          Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
          Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
          Gerrit-Attention: Sean Li <sea...@google.com>
          Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Attention: Markus Handell <hand...@google.com>
          Gerrit-Comment-Date: Wed, 15 Jul 2026 21:28:40 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Colin Blundell (Gerrit)

          unread,
          Jul 17, 2026, 7:15:10 AMJul 17
          to Eugene Zemtsov, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
          Attention needed from Eugene Zemtsov, Henrik Boström, Markus Handell and Sean Li

          Colin Blundell added 1 comment

          Patchset-level comments
          Colin Blundell . resolved

          Thanks! hbos@, could you review //services/video_capture as closer OWNER?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Eugene Zemtsov
          • Henrik Boström
          • Markus Handell
          • Sean Li
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not 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: Ic4709675749deeee32088e336cccb6a53e460ca0
          Gerrit-Change-Number: 8029420
          Gerrit-PatchSet: 8
          Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
          Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Reviewer: Henrik Boström <hb...@chromium.org>
          Gerrit-Reviewer: Markus Handell <hand...@google.com>
          Gerrit-Reviewer: Sean Li <sea...@google.com>
          Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
          Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
          Gerrit-Attention: Sean Li <sea...@google.com>
          Gerrit-Attention: Henrik Boström <hb...@chromium.org>
          Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
          Gerrit-Attention: Markus Handell <hand...@google.com>
          Gerrit-Comment-Date: Fri, 17 Jul 2026 11:14:48 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Sean Li (Gerrit)

          unread,
          Jul 19, 2026, 10:38:52 PM (13 days ago) Jul 19
          to Eugene Zemtsov, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
          Attention needed from Eugene Zemtsov, Henrik Boström and Markus Handell

          Sean Li added 2 comments

          File media/capture/video/android/video_capture_device_android.cc
          Line 232, Patchset 8 (Latest): hardware_buffer_available_cb_ = base::BindPostTask(
          Sean Li . unresolved

          Why do we save callback here, and validate it in `OnHardwareBufferAvailable`?

          File services/video_capture/video_capture_service_impl.cc
          Line 274, Patchset 8 (Latest): class Core final : public base::RefCountedDeleteOnSequence<Core>,
          Sean Li . unresolved

          `BrowserGpuChannelHostProvider` is deleted on the UI thread. Why do we need `RefCountedDeleteOnSequence` here?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Eugene Zemtsov
          • Henrik Boström
          • Markus Handell
          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: Ic4709675749deeee32088e336cccb6a53e460ca0
            Gerrit-Change-Number: 8029420
            Gerrit-PatchSet: 8
            Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
            Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
            Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
            Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
            Gerrit-Reviewer: Henrik Boström <hb...@chromium.org>
            Gerrit-Reviewer: Markus Handell <hand...@google.com>
            Gerrit-Reviewer: Sean Li <sea...@google.com>
            Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
            Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
            Gerrit-Attention: Henrik Boström <hb...@chromium.org>
            Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
            Gerrit-Attention: Markus Handell <hand...@google.com>
            Gerrit-Comment-Date: Mon, 20 Jul 2026 02:38:17 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Sean Li (Gerrit)

            unread,
            Jul 19, 2026, 10:43:58 PM (13 days ago) Jul 19
            to Eugene Zemtsov, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
            Attention needed from Eugene Zemtsov, Henrik Boström and Markus Handell

            Sean Li added 1 comment

            File media/capture/video/android/video_capture_device_android.cc
            Line 232, Patchset 8 (Latest): hardware_buffer_available_cb_ = base::BindPostTask(
            Sean Li . unresolved

            Why do we save callback here, and validate it in `OnHardwareBufferAvailable`?

            Sean Li

            I just saw the comment. However, if there is already a `OnHardwareBufferAvailableOnMainThread` queued before `hardware_buffer_available_cb_` is set to `null`, it still have a change to execute.

            Gerrit-Comment-Date: Mon, 20 Jul 2026 02:43:23 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Sean Li <sea...@google.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Eugene Zemtsov (Gerrit)

            unread,
            Jul 21, 2026, 4:21:53 PM (12 days ago) Jul 21
            to Eugene Zemtsov, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
            Attention needed from Henrik Boström, Markus Handell and Sean Li

            Eugene Zemtsov added 2 comments

            File media/capture/video/android/video_capture_device_android.cc
            Line 232, Patchset 8: hardware_buffer_available_cb_ = base::BindPostTask(
            Sean Li . resolved

            Why do we save callback here, and validate it in `OnHardwareBufferAvailable`?

            Sean Li

            I just saw the comment. However, if there is already a `OnHardwareBufferAvailableOnMainThread` queued before `hardware_buffer_available_cb_` is set to `null`, it still have a change to execute.

            Eugene Zemtsov

            Good point. The added `InvalidateWeakPtrs()` call resolves this.

            File services/video_capture/video_capture_service_impl.cc
            Line 274, Patchset 8: class Core final : public base::RefCountedDeleteOnSequence<Core>,
            Sean Li . unresolved

            `BrowserGpuChannelHostProvider` is deleted on the UI thread. Why do we need `RefCountedDeleteOnSequence` here?

            Eugene Zemtsov

            While BrowserGpuChannelHostProvider is destroyed on the UI thread, Core implements `gpu::GpuChannelLostObserver::OnGpuChannelLost()`.

            `OnGpuChannelLost()` is called on the IPC/GPU thread, where `base::BindOnce(&Core::OnGpuChannelLostOnUIThread, this)` increments Core's reference count off the UI thread.


            If the last `scoped_refptr<Core>` reference is released on the IPC thread (or during sequence shutdown), `Core` would be destructed on a non-UI thread without `base::RefCountedDeleteOnSequence<Core>`.
            `RefCountedDeleteOnSequence` ensures `~Core()` is guaranteed to execute on the UI task runner.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Henrik Boström
            • Markus Handell
            • Sean Li
            Gerrit-Attention: Sean Li <sea...@google.com>
            Gerrit-Attention: Henrik Boström <hb...@chromium.org>
            Gerrit-Attention: Markus Handell <hand...@google.com>
            Gerrit-Comment-Date: Tue, 21 Jul 2026 20:21:37 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Eugene Zemtsov (Gerrit)

            unread,
            Jul 21, 2026, 4:24:12 PM (12 days ago) Jul 21
            to Eugene Zemtsov, Daniel Cheng, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
            Attention needed from Daniel Cheng, Henrik Boström, Markus Handell and Sean Li

            Eugene Zemtsov added 2 comments

            Patchset-level comments
            File-level comment, Patchset 9 (Latest):
            Eugene Zemtsov . resolved

            +dcheng because other reviewers seem to be unavailable.

            File services/video_capture/video_capture_service_impl.cc
            Line 274, Patchset 8: class Core final : public base::RefCountedDeleteOnSequence<Core>,
            Sean Li . resolved

            `BrowserGpuChannelHostProvider` is deleted on the UI thread. Why do we need `RefCountedDeleteOnSequence` here?

            Eugene Zemtsov

            While BrowserGpuChannelHostProvider is destroyed on the UI thread, Core implements `gpu::GpuChannelLostObserver::OnGpuChannelLost()`.

            `OnGpuChannelLost()` is called on the IPC/GPU thread, where `base::BindOnce(&Core::OnGpuChannelLostOnUIThread, this)` increments Core's reference count off the UI thread.


            If the last `scoped_refptr<Core>` reference is released on the IPC thread (or during sequence shutdown), `Core` would be destructed on a non-UI thread without `base::RefCountedDeleteOnSequence<Core>`.
            `RefCountedDeleteOnSequence` ensures `~Core()` is guaranteed to execute on the UI task runner.
            Eugene Zemtsov

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Daniel Cheng
            • Henrik Boström
            • Markus Handell
            • Sean Li
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not 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: Ic4709675749deeee32088e336cccb6a53e460ca0
                Gerrit-Change-Number: 8029420
                Gerrit-PatchSet: 9
                Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                Gerrit-Reviewer: Henrik Boström <hb...@chromium.org>
                Gerrit-Reviewer: Markus Handell <hand...@google.com>
                Gerrit-Reviewer: Sean Li <sea...@google.com>
                Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                Gerrit-Attention: Sean Li <sea...@google.com>
                Gerrit-Attention: Henrik Boström <hb...@chromium.org>
                Gerrit-Attention: Markus Handell <hand...@google.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Comment-Date: Tue, 21 Jul 2026 20:23:59 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Sean Li <sea...@google.com>
                Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Daniel Cheng (Gerrit)

                unread,
                Jul 21, 2026, 4:53:17 PM (12 days ago) Jul 21
                to Eugene Zemtsov, Daniel Cheng, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                Attention needed from Eugene Zemtsov, Henrik Boström, Markus Handell and Sean Li

                Daniel Cheng added 2 comments

                Patchset-level comments
                Daniel Cheng . resolved

                I am in top-level owners for //services, but I'm not really qualified to review capture code.

                Would it make sense for there to be more OWNERS? e.g. would vasilyt@ be a good addition? :)

                File services/video_capture/video_capture_service_impl.cc
                Line 274, Patchset 9 (Latest): class Core final : public base::RefCountedDeleteOnSequence<Core>,
                Daniel Cheng . unresolved

                Probably worth adding some comments here about the threading requirements.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Eugene Zemtsov
                • Henrik Boström
                • Markus Handell
                • Sean Li
                  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: Ic4709675749deeee32088e336cccb6a53e460ca0
                    Gerrit-Change-Number: 8029420
                    Gerrit-PatchSet: 9
                    Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                    Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                    Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                    Gerrit-Reviewer: Henrik Boström <hb...@chromium.org>
                    Gerrit-Reviewer: Markus Handell <hand...@google.com>
                    Gerrit-Reviewer: Sean Li <sea...@google.com>
                    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                    Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                    Gerrit-Attention: Sean Li <sea...@google.com>
                    Gerrit-Attention: Henrik Boström <hb...@chromium.org>
                    Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
                    Gerrit-Attention: Markus Handell <hand...@google.com>
                    Gerrit-Comment-Date: Tue, 21 Jul 2026 20:53:04 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Sean Li (Gerrit)

                    unread,
                    Jul 22, 2026, 5:20:01 AM (11 days ago) Jul 22
                    to Eugene Zemtsov, Daniel Cheng, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                    Attention needed from Eugene Zemtsov, Henrik Boström and Markus Handell

                    Sean Li added 1 comment

                    File services/video_capture/video_capture_service_impl.cc
                    Line 274, Patchset 8: class Core final : public base::RefCountedDeleteOnSequence<Core>,
                    Sean Li . unresolved

                    `BrowserGpuChannelHostProvider` is deleted on the UI thread. Why do we need `RefCountedDeleteOnSequence` here?

                    Eugene Zemtsov

                    While BrowserGpuChannelHostProvider is destroyed on the UI thread, Core implements `gpu::GpuChannelLostObserver::OnGpuChannelLost()`.

                    `OnGpuChannelLost()` is called on the IPC/GPU thread, where `base::BindOnce(&Core::OnGpuChannelLostOnUIThread, this)` increments Core's reference count off the UI thread.


                    If the last `scoped_refptr<Core>` reference is released on the IPC thread (or during sequence shutdown), `Core` would be destructed on a non-UI thread without `base::RefCountedDeleteOnSequence<Core>`.
                    `RefCountedDeleteOnSequence` ensures `~Core()` is guaranteed to execute on the UI task runner.
                    Eugene Zemtsov

                    Done

                    Sean Li

                    GpuChannelHost use a [lock](https://source.chromium.org/chromium/chromium/src/+/main:gpu/ipc/client/gpu_channel_host.cc;l=498-511) to keep thread-safety. IIUC, we don't have to use `RefCountedDeleteOnSequence`. We can just let `Core` released with `BrowserGpuChannelHostProvider` on the UI thread, and use `getWeakPtr()` in OnGpuChannelLost().

                    ```
                    void OnGpuChannelLost() override {
                    ui_task_runner_->PostTask(
                    FROM_HERE, base::BindOnce(&Core::OnGpuChannelLostOnUIThread, getWeakPtr()));
                    }
                    ```

                    Even more, we don't need to have `Core(delegate)` pattern for this. Or, we can use `DeleteSoon` to release `Core` instead of releasing `BrowserGpuChannelHostProvider`.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Eugene Zemtsov
                    • Henrik Boström
                    • Markus Handell
                    Gerrit-Attention: Henrik Boström <hb...@chromium.org>
                    Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
                    Gerrit-Attention: Markus Handell <hand...@google.com>
                    Gerrit-Comment-Date: Wed, 22 Jul 2026 09:19:29 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Colin Blundell (Gerrit)

                    unread,
                    Jul 22, 2026, 10:49:29 AM (11 days ago) Jul 22
                    to Eugene Zemtsov, Daniel Cheng, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                    Attention needed from Eugene Zemtsov, Henrik Boström and Markus Handell

                    Colin Blundell added 1 comment

                    Patchset-level comments
                    Colin Blundell . resolved

                    @vas...@chromium.org, could you do the technical review and LGTM of //services/video_capture as well? I'm happy to stamp for OWNERS once you've LGTM'd it. Thanks!

                    Gerrit-Comment-Date: Wed, 22 Jul 2026 14:49:09 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Eugene Zemtsov (Gerrit)

                    unread,
                    Jul 28, 2026, 7:41:43 PM (4 days ago) Jul 28
                    to Eugene Zemtsov, Daniel Cheng, Henrik Boström, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                    Attention needed from Henrik Boström and Markus Handell

                    Eugene Zemtsov added 2 comments

                    File services/video_capture/video_capture_service_impl.cc
                    Line 274, Patchset 8: class Core final : public base::RefCountedDeleteOnSequence<Core>,
                    Sean Li . resolved

                    `BrowserGpuChannelHostProvider` is deleted on the UI thread. Why do we need `RefCountedDeleteOnSequence` here?

                    Eugene Zemtsov

                    While BrowserGpuChannelHostProvider is destroyed on the UI thread, Core implements `gpu::GpuChannelLostObserver::OnGpuChannelLost()`.

                    `OnGpuChannelLost()` is called on the IPC/GPU thread, where `base::BindOnce(&Core::OnGpuChannelLostOnUIThread, this)` increments Core's reference count off the UI thread.


                    If the last `scoped_refptr<Core>` reference is released on the IPC thread (or during sequence shutdown), `Core` would be destructed on a non-UI thread without `base::RefCountedDeleteOnSequence<Core>`.
                    `RefCountedDeleteOnSequence` ensures `~Core()` is guaranteed to execute on the UI task runner.
                    Eugene Zemtsov

                    Done

                    Sean Li

                    GpuChannelHost use a [lock](https://source.chromium.org/chromium/chromium/src/+/main:gpu/ipc/client/gpu_channel_host.cc;l=498-511) to keep thread-safety. IIUC, we don't have to use `RefCountedDeleteOnSequence`. We can just let `Core` released with `BrowserGpuChannelHostProvider` on the UI thread, and use `getWeakPtr()` in OnGpuChannelLost().

                    ```
                    void OnGpuChannelLost() override {
                    ui_task_runner_->PostTask(
                    FROM_HERE, base::BindOnce(&Core::OnGpuChannelLostOnUIThread, getWeakPtr()));
                    }
                    ```

                    Even more, we don't need to have `Core(delegate)` pattern for this. Or, we can use `DeleteSoon` to release `Core` instead of releasing `BrowserGpuChannelHostProvider`.

                    Eugene Zemtsov

                    Unfortunately, neither WeakPtr nor DeleteSoon without refcounting works here due to cross-thread sequence safety:

                      1. WeakPtr sequence safety: weak_ptr_factory_ is bound to the UI sequence (`ui_task_runner_`), but `GpuChannelHost` invokes `OnGpuChannelLost()` on the GPU/IO thread. Calling `GetWeakPtr()` on the IO thread
                    is unsafe and triggers sequence checker DCHECKs / data races. GpuChannelHost's internal lock only protects its own observer list iteration, not Core's members.
                    2. DeleteSoon & Lifetime: Without refcounting, posting `OnGpuChannelLostOnUIThread` from the IO thread using `base::Unretained(this)` would race with `DeleteSoon` on the UI thread. If `DeleteSoon` executes
                    first on the UI thread, the callback task executes on a deleted pointer.
                    Line 274, Patchset 9: class Core final : public base::RefCountedDeleteOnSequence<Core>,
                    Daniel Cheng . resolved

                    Probably worth adding some comments here about the threading requirements.

                    Eugene Zemtsov

                    Done. Added a comment documenting the threading model and why RefCountedDeleteOnSequence is required.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Henrik Boström
                    • Markus Handell
                    Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not 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: Ic4709675749deeee32088e336cccb6a53e460ca0
                      Gerrit-Change-Number: 8029420
                      Gerrit-PatchSet: 9
                      Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                      Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                      Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                      Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                      Gerrit-Reviewer: Henrik Boström <hb...@chromium.org>
                      Gerrit-Reviewer: Markus Handell <hand...@google.com>
                      Gerrit-Reviewer: Sean Li <sea...@google.com>
                      Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                      Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                      Gerrit-Attention: Henrik Boström <hb...@chromium.org>
                      Gerrit-Attention: Markus Handell <hand...@google.com>
                      Gerrit-Comment-Date: Tue, 28 Jul 2026 23:41:34 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: No
                      Comment-In-Reply-To: Sean Li <sea...@google.com>
                      Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>
                      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Eugene Zemtsov (Gerrit)

                      unread,
                      Jul 28, 2026, 7:56:35 PM (4 days ago) Jul 28
                      to Eugene Zemtsov, Henrik Boström, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                      Attention needed from Markus Handell

                      Eugene Zemtsov removed Henrik Boström from this change

                      Deleted Reviewers:
                      • Henrik Boström
                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Markus Handell
                      Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not 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: deleteReviewer
                      Gerrit-Project: chromium/src
                      Gerrit-Branch: main
                      Gerrit-Change-Id: Ic4709675749deeee32088e336cccb6a53e460ca0
                      Gerrit-Change-Number: 8029420
                      Gerrit-PatchSet: 10
                      Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                      Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                      Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                      Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                      Gerrit-Reviewer: Markus Handell <hand...@google.com>
                      Gerrit-Reviewer: Sean Li <sea...@google.com>
                      Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                      Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                      Gerrit-Attention: Markus Handell <hand...@google.com>
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Sean Li (Gerrit)

                      unread,
                      Jul 28, 2026, 11:54:27 PM (4 days ago) Jul 28
                      to Eugene Zemtsov, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                      Attention needed from Eugene Zemtsov and Markus Handell

                      Sean Li added 1 comment

                      File services/video_capture/video_capture_service_impl.cc
                      Line 274, Patchset 8: class Core final : public base::RefCountedDeleteOnSequence<Core>,
                      Sean Li . unresolved

                      `BrowserGpuChannelHostProvider` is deleted on the UI thread. Why do we need `RefCountedDeleteOnSequence` here?

                      Eugene Zemtsov

                      While BrowserGpuChannelHostProvider is destroyed on the UI thread, Core implements `gpu::GpuChannelLostObserver::OnGpuChannelLost()`.

                      `OnGpuChannelLost()` is called on the IPC/GPU thread, where `base::BindOnce(&Core::OnGpuChannelLostOnUIThread, this)` increments Core's reference count off the UI thread.


                      If the last `scoped_refptr<Core>` reference is released on the IPC thread (or during sequence shutdown), `Core` would be destructed on a non-UI thread without `base::RefCountedDeleteOnSequence<Core>`.
                      `RefCountedDeleteOnSequence` ensures `~Core()` is guaranteed to execute on the UI task runner.
                      Eugene Zemtsov

                      Done

                      Sean Li

                      GpuChannelHost use a [lock](https://source.chromium.org/chromium/chromium/src/+/main:gpu/ipc/client/gpu_channel_host.cc;l=498-511) to keep thread-safety. IIUC, we don't have to use `RefCountedDeleteOnSequence`. We can just let `Core` released with `BrowserGpuChannelHostProvider` on the UI thread, and use `getWeakPtr()` in OnGpuChannelLost().

                      ```
                      void OnGpuChannelLost() override {
                      ui_task_runner_->PostTask(
                      FROM_HERE, base::BindOnce(&Core::OnGpuChannelLostOnUIThread, getWeakPtr()));
                      }
                      ```

                      Even more, we don't need to have `Core(delegate)` pattern for this. Or, we can use `DeleteSoon` to release `Core` instead of releasing `BrowserGpuChannelHostProvider`.

                      Eugene Zemtsov

                      Unfortunately, neither WeakPtr nor DeleteSoon without refcounting works here due to cross-thread sequence safety:

                        1. WeakPtr sequence safety: weak_ptr_factory_ is bound to the UI sequence (`ui_task_runner_`), but `GpuChannelHost` invokes `OnGpuChannelLost()` on the GPU/IO thread. Calling `GetWeakPtr()` on the IO thread
                      is unsafe and triggers sequence checker DCHECKs / data races. GpuChannelHost's internal lock only protects its own observer list iteration, not Core's members.
                      2. DeleteSoon & Lifetime: Without refcounting, posting `OnGpuChannelLostOnUIThread` from the IO thread using `base::Unretained(this)` would race with `DeleteSoon` on the UI thread. If `DeleteSoon` executes
                      first on the UI thread, the callback task executes on a deleted pointer.
                      Sean Li

                      From [base/memory/weak_ptr.h](https://source.chromium.org/chromium/chromium/src/+/main:base/memory/weak_ptr.h;l=50-69;drc=853aabf2c9c58f9e0389c13ed41d843806dca3b9),

                      `weak_ptr` must always be dereferenced and invalidated on the same SequencedTaskRunner otherwise checking the pointer would be racey.

                      IIUC, the only limitation is: `weak_ptr` has to dereferenced on one sequence(`ui_task_runner_`) and `weak_ptr_factory_` has to be destroyed on the some sequence since it invalidated all of the `weak_ptr`s in the destructor.

                      `GetWeakPtr()` is ok to be called on any sequence.

                      Take the code in Ash VCD as example,
                      [CameraHalDelegate::SetCameraModuleOnIpcThread](https://source.chromium.org/chromium/chromium/src/+/main:media/capture/video/chromeos/camera_hal_delegate.cc;l=452-469;drc=e90bc5c44ab2617de657fe534770d5a7ca51274e) ->[CameraHalDelegate::NotifyVideoCaptureDevicesChanged()](https://source.chromium.org/chromium/chromium/src/+/main:media/capture/video/chromeos/camera_hal_delegate.cc;l=1088-1090;drc=853aabf2c9c58f9e0389c13ed41d843806dca3b9) -> [SystemEventMonitorProxy::NotifyVideoCaptureDevicesChanged](https://source.chromium.org/chromium/chromium/src/+/main:media/capture/video/chromeos/camera_hal_delegate.cc;l=162-168;drc=853aabf2c9c58f9e0389c13ed41d843806dca3b9) run on the `IPC thread`, and it call `GetWeakPtr` on a `WeakPtrFactory` which is bound on the UI thread.

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Eugene Zemtsov
                      • Markus Handell
                      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: Ic4709675749deeee32088e336cccb6a53e460ca0
                        Gerrit-Change-Number: 8029420
                        Gerrit-PatchSet: 10
                        Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                        Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                        Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                        Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                        Gerrit-Reviewer: Markus Handell <hand...@google.com>
                        Gerrit-Reviewer: Sean Li <sea...@google.com>
                        Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                        Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                        Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
                        Gerrit-Attention: Markus Handell <hand...@google.com>
                        Gerrit-Comment-Date: Wed, 29 Jul 2026 03:53:52 +0000
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Vasiliy Telezhnikov (Gerrit)

                        unread,
                        Jul 29, 2026, 1:36:15 PM (4 days ago) Jul 29
                        to Eugene Zemtsov, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                        Attention needed from Eugene Zemtsov and Markus Handell

                        Vasiliy Telezhnikov voted and added 2 comments

                        Votes added by Vasiliy Telezhnikov

                        Code-Review+0

                        2 comments

                        Patchset-level comments
                        File-level comment, Patchset 10 (Latest):
                        Vasiliy Telezhnikov . resolved

                        Sorry for the delay, this slipped from my attention set.

                        File services/video_capture/video_capture_service_impl.cc
                        Vasiliy Telezhnikov

                        There is another non-obvious requirement that `GetWeakPtr` is called on the same thread as `InvalidateWeakPtrs` (and so it makes everything single threaded, as this needs to happen on the same thread as dereference happen), but as we don't call `InvalidateWeakPtrs` on this weakptr factory, this is fine and we can call GetWeakPtr on io thread.

                        We actually do this right in this file just above in `VideoCaptureServiceImpl::VizGpuContextProvider`. And the related questions, why do we need different BrowserGpuChannelHostProvider instead of using the one above?

                        Gerrit-Comment-Date: Wed, 29 Jul 2026 17:36:05 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: Yes
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Sean Li (Gerrit)

                        unread,
                        Jul 29, 2026, 2:08:23 PM (4 days ago) Jul 29
                        to Eugene Zemtsov, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                        Attention needed from Eugene Zemtsov and Markus Handell

                        Sean Li added 1 comment

                        File services/video_capture/video_capture_service_impl.cc
                        Sean Li

                        Why do we need different BrowserGpuChannelHostProvider instead of using the one above?

                        VizGpuContextProvider establishes the GPU channel synchronously but establishment of the GPU channel in browser process has to be asynchronous. Therefore, VizGpuContextProvider is for service in utility process, and BrowserGpuChannelHostProvider is for service in browser process.

                        Context: https://chromium-review.git.corp.google.com/c/chromium/src/+/7836765

                        Gerrit-Comment-Date: Wed, 29 Jul 2026 18:07:46 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Sean Li <sea...@google.com>
                        Comment-In-Reply-To: Eugene Zemtsov <eug...@chromium.org>
                        Comment-In-Reply-To: Vasiliy Telezhnikov <vas...@chromium.org>
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Vasiliy Telezhnikov (Gerrit)

                        unread,
                        Jul 30, 2026, 3:52:11 PM (3 days ago) Jul 30
                        to Eugene Zemtsov, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                        Attention needed from Eugene Zemtsov and Markus Handell

                        Vasiliy Telezhnikov added 4 comments

                        File media/capture/video/android/video_capture_device_android.h
                        Line 261, Patchset 10 (Latest): base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_{this};
                        Vasiliy Telezhnikov . unresolved

                        This now can be used only on main thread, which is not obvious. Can you add `GUARDED_BY_CONTEXT` and sequence checker?

                        Ideally we should avoid InvalidateWeakPtrs, but that would require some other ways to discard old callbacks (e.g a counter that we increment in Start and compare in callback or inner object that is alive only when we started), but I don't have strong feelings about this.

                        File services/video_capture/video_capture_service_impl.cc
                        Vasiliy Telezhnikov

                        In the capture machinery is fine with async, could we just have one class that is always Async? There is quite a bit of code churn here.

                        Line 390, Patchset 10 (Latest): media::VideoCaptureGpuChannelHost::GetInstance().OnContextLost();
                        Vasiliy Telezhnikov . unresolved

                        Question: Why do we call OnContextLost when we just restored the context? Is it just telling observers that "something changed"?

                        Line 409, Patchset 10 (Latest): retry_delay_ = std::min(retry_delay_ * 2, base::Seconds(30));
                        Vasiliy Telezhnikov . unresolved

                        I don't think there is point of doing delay logic, you can retry immediately. The only way why establishing channel is supposed to fail if newly started gpu process crashes during start up.

                        Adding delay will not help with that.

                        Gerrit-Comment-Date: Thu, 30 Jul 2026 19:51:57 +0000
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Eugene Zemtsov (Gerrit)

                        unread,
                        Jul 31, 2026, 6:17:21 PM (2 days ago) Jul 31
                        to Eugene Zemtsov, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Vasiliy Telezhnikov, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                        Attention needed from Markus Handell, Sean Li and Vasiliy Telezhnikov

                        Eugene Zemtsov added 4 comments

                        File media/capture/video/android/video_capture_device_android.h
                        Line 261, Patchset 10: base::WeakPtrFactory<VideoCaptureDeviceAndroid> weak_ptr_factory_{this};
                        Vasiliy Telezhnikov . resolved

                        This now can be used only on main thread, which is not obvious. Can you add `GUARDED_BY_CONTEXT` and sequence checker?

                        Ideally we should avoid InvalidateWeakPtrs, but that would require some other ways to discard old callbacks (e.g a counter that we increment in Start and compare in callback or inner object that is alive only when we started), but I don't have strong feelings about this.

                        Eugene Zemtsov

                        Done. Added SEQUENCE_CHECKER(main_sequence_checker_); and annotated weak_ptr_factory_ (and main-thread methods) with GUARDED_BY_CONTEXT(main_sequence_checker_).

                        File services/video_capture/video_capture_service_impl.cc
                        Line 274, Patchset 8: class Core final : public base::RefCountedDeleteOnSequence<Core>,
                        Sean Li . resolved
                        Eugene Zemtsov

                        Done. Combined `VizGpuContextProvider` and `BrowserGpuChannelHostProvider` into `GpuChannelHostProvider`

                        Line 390, Patchset 10: media::VideoCaptureGpuChannelHost::GetInstance().OnContextLost();
                        Vasiliy Telezhnikov . resolved

                        Question: Why do we call OnContextLost when we just restored the context? Is it just telling observers that "something changed"?

                        Eugene Zemtsov

                        Yes. `OnContextLost()` signals `VideoCaptureDeviceAndroid` to invalidate cached YCbCr info and stale shared image handles so they re-query parameters against the new GPU channel.

                        Line 409, Patchset 10: retry_delay_ = std::min(retry_delay_ * 2, base::Seconds(30));
                        Vasiliy Telezhnikov . resolved

                        I don't think there is point of doing delay logic, you can retry immediately. The only way why establishing channel is supposed to fail if newly started gpu process crashes during start up.

                        Adding delay will not help with that.

                        Eugene Zemtsov

                        I removed the delay timer and capped retries to a maximum of 3 attempts. The reconnect task is delayed by 20ms though.

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Markus Handell
                        • Sean Li
                        • Vasiliy Telezhnikov
                        Submit Requirements:
                          • requirement satisfiedCode-Coverage
                          • requirement is not 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: Ic4709675749deeee32088e336cccb6a53e460ca0
                          Gerrit-Change-Number: 8029420
                          Gerrit-PatchSet: 13
                          Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                          Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                          Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                          Gerrit-Reviewer: Markus Handell <hand...@google.com>
                          Gerrit-Reviewer: Sean Li <sea...@google.com>
                          Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                          Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                          Gerrit-Attention: Sean Li <sea...@google.com>
                          Gerrit-Attention: Markus Handell <hand...@google.com>
                          Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
                          Gerrit-Comment-Date: Fri, 31 Jul 2026 22:17:08 +0000
                          satisfied_requirement
                          unsatisfied_requirement
                          open
                          diffy

                          Vasiliy Telezhnikov (Gerrit)

                          unread,
                          Aug 1, 2026, 7:36:01 PM (12 hours ago) Aug 1
                          to Eugene Zemtsov, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                          Attention needed from Eugene Zemtsov, Markus Handell and Sean Li

                          Vasiliy Telezhnikov voted and added 1 comment

                          Votes added by Vasiliy Telezhnikov

                          Code-Review+1

                          1 comment

                          Patchset-level comments
                          File-level comment, Patchset 13 (Latest):
                          Vasiliy Telezhnikov . resolved

                          lgtm, thanks!

                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Eugene Zemtsov
                          • Markus Handell
                          • Sean Li
                          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: Ic4709675749deeee32088e336cccb6a53e460ca0
                          Gerrit-Change-Number: 8029420
                          Gerrit-PatchSet: 13
                          Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                          Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                          Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                          Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                          Gerrit-Reviewer: Markus Handell <hand...@google.com>
                          Gerrit-Reviewer: Sean Li <sea...@google.com>
                          Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                          Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                          Gerrit-Attention: Sean Li <sea...@google.com>
                          Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
                          Gerrit-Attention: Markus Handell <hand...@google.com>
                          Gerrit-Comment-Date: Sat, 01 Aug 2026 23:35:43 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: Yes
                          satisfied_requirement
                          open
                          diffy

                          Vasiliy Telezhnikov (Gerrit)

                          unread,
                          Aug 1, 2026, 7:36:21 PM (12 hours ago) Aug 1
                          to Eugene Zemtsov, Daniel Cheng, Colin Blundell, Dave Tapuska, Markus Handell, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                          Attention needed from Eugene Zemtsov, Markus Handell and Sean Li

                          Vasiliy Telezhnikov added 1 comment

                          Commit Message
                          Line 12, Patchset 13 (Latest):- services/video_capture: Generalized BrowserGpuChannelHostProvider and refactored it with a thread-safe Core helper to safely handle GPU loss. Added exponential backoff retries for GPU channel establishment.
                          Vasiliy Telezhnikov . unresolved

                          nit: commit message is a bit outdated now.

                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Eugene Zemtsov
                          • Markus Handell
                          • Sean Li
                          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: Ic4709675749deeee32088e336cccb6a53e460ca0
                            Gerrit-Change-Number: 8029420
                            Gerrit-PatchSet: 13
                            Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                            Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                            Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                            Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                            Gerrit-Reviewer: Markus Handell <hand...@google.com>
                            Gerrit-Reviewer: Sean Li <sea...@google.com>
                            Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                            Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                            Gerrit-Attention: Sean Li <sea...@google.com>
                            Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
                            Gerrit-Attention: Markus Handell <hand...@google.com>
                            Gerrit-Comment-Date: Sat, 01 Aug 2026 23:36:10 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            satisfied_requirement
                            unsatisfied_requirement
                            open
                            diffy

                            Markus Handell (Gerrit)

                            unread,
                            3:25 AM (4 hours ago) 3:25 AM
                            to Eugene Zemtsov, Ilya Nikolaevskiy, Vasiliy Telezhnikov, Daniel Cheng, Colin Blundell, Dave Tapuska, Sean Li, Chromium LUCI CQ, chromium...@chromium.org, Rijubrata Bhaumik, cblume...@chromium.org, chfreme...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, mfoltz+wa...@chromium.org, penghuan...@chromium.org
                            Attention needed from Eugene Zemtsov, Ilya Nikolaevskiy and Sean Li

                            Markus Handell added 1 comment

                            Patchset-level comments
                            Markus Handell . resolved

                            Deferring to Ilya.

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Eugene Zemtsov
                            • Ilya Nikolaevskiy
                            • Sean Li
                            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: Ic4709675749deeee32088e336cccb6a53e460ca0
                            Gerrit-Change-Number: 8029420
                            Gerrit-PatchSet: 13
                            Gerrit-Owner: Eugene Zemtsov <eug...@chromium.org>
                            Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
                            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                            Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
                            Gerrit-Reviewer: Eugene Zemtsov <eug...@chromium.org>
                            Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
                            Gerrit-Reviewer: Sean Li <sea...@google.com>
                            Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
                            Gerrit-CC: Markus Handell <hand...@google.com>
                            Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
                            Gerrit-Attention: Sean Li <sea...@google.com>
                            Gerrit-Attention: Eugene Zemtsov <eug...@chromium.org>
                            Gerrit-Attention: Ilya Nikolaevskiy <il...@chromium.org>
                            Gerrit-Comment-Date: Sun, 02 Aug 2026 07:25:08 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            satisfied_requirement
                            unsatisfied_requirement
                            open
                            diffy
                            Reply all
                            Reply to author
                            Forward
                            0 new messages