New issue
Advanced search Search tips

Issue 802216 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: 1
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Incorrect iteration logic in VideoCaptureHost::RenderProcessHostDelegate::NotifyAllStreamsRemoved

Project Member Reported by kkinnu...@nvidia.com, Jan 16 2018

Issue description

Incorrect iteration logic in VideoCaptureHost::RenderProcessHostDelegate::NotifyAllStreamsRemoved()

The code does:

 for (uint32_t i = 0; i < number_of_active_streams_; ++i)
      NotifyStreamRemoved();


NotifyStreamRemoved() will decrease number_of_active_streams_.

This means one notification is skipped per iteration.

Also minor thing: RenderProcessHostDelegate holds render process id with int, though others might hold it with uint32_t.
 
Cc: -emir...@chromium.org chfremer@chromium.org
Owner: emir...@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/943e253fab89d016d4c5895f5d272af765a8df8f

commit 943e253fab89d016d4c5895f5d272af765a8df8f
Author: Emircan Uysaler <emircan@chromium.org>
Date: Fri Jan 19 20:55:39 2018

Fix iteration logic in RenderProcessHostDelegate::NotifyAllStreamsRemoved

This CL fixes the iteration bug. Additionally, it refactors classes so that
this can be testable by adding an interface: RenderProcessHostDelegate. This
interface is mocked to track number of function calls.
Also, it changes |render_process_id| from int to uint32_t.

Bug:  802216 
Change-Id: I31fb05111ab1d63e5caa1a81e0b6feee55bcecae
Reviewed-on: https://chromium-review.googlesource.com/869251
Commit-Queue: Emircan Uysaler <emircan@chromium.org>
Reviewed-by: Christian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530604}
[modify] https://crrev.com/943e253fab89d016d4c5895f5d272af765a8df8f/content/browser/renderer_host/media/video_capture_host.cc
[modify] https://crrev.com/943e253fab89d016d4c5895f5d272af765a8df8f/content/browser/renderer_host/media/video_capture_host.h
[modify] https://crrev.com/943e253fab89d016d4c5895f5d272af765a8df8f/content/browser/renderer_host/media/video_capture_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment