Incorrect iteration logic in VideoCaptureHost::RenderProcessHostDelegate::NotifyAllStreamsRemoved |
|||
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.
,
Jan 16 2018
,
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
,
Jan 19 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by emir...@chromium.org
, Jan 16 2018Owner: emir...@chromium.org