Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Issue 1247973002: Fix race condition when accessing time_progressing_. (Closed)

Created:
5 years, 5 months ago by DaleCurtis
Modified:
5 years, 5 months ago
Reviewers:
xhwang
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix race condition when accessing time_progressing_. The |time_progressing_| variable should only be accessed via the media thread, it can't be accessed under lock since it is set during a call which may be reentrant to locked methods. The fix is to use a proxy for |time_progressing_| when called from other threads; luckily the inverse of |render_first_frame_and_stop_| will suffice. BUG=512371 TEST=media_unittests Committed: https://crrev.com/a10468d1cf8729983532b6b0e2595722ea284fbe Cr-Commit-Position: refs/heads/master@{#339817}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Comments. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -13 lines) Patch
M media/renderers/video_renderer_impl.h View 1 3 chunks +13 lines, -4 lines 0 comments Download
M media/renderers/video_renderer_impl.cc View 1 5 chunks +20 lines, -9 lines 1 comment Download

Messages

Total messages: 10 (2 generated)
DaleCurtis
5 years, 5 months ago (2015-07-21 19:01:07 UTC) #2
DaleCurtis
WDYT? I thought about adding a "if (belongs_to_current_thread)" but that seemed uglier.
5 years, 5 months ago (2015-07-21 19:01:30 UTC) #3
xhwang
looking good, one question about the "inverse of |render_first_frame_and_stop_|" and some nits. https://codereview.chromium.org/1247973002/diff/1/media/renderers/video_renderer_impl.cc File media/renderers/video_renderer_impl.cc ...
5 years, 5 months ago (2015-07-21 21:01:38 UTC) #4
DaleCurtis
https://codereview.chromium.org/1247973002/diff/1/media/renderers/video_renderer_impl.cc File media/renderers/video_renderer_impl.cc (right): https://codereview.chromium.org/1247973002/diff/1/media/renderers/video_renderer_impl.cc#newcode217 media/renderers/video_renderer_impl.cc:217: MaybeFireEndedCallback(!render_first_frame_and_stop_); On 2015/07/21 21:01:38, xhwang wrote: > Can you ...
5 years, 5 months ago (2015-07-22 00:44:44 UTC) #5
xhwang
LGTM! https://codereview.chromium.org/1247973002/diff/20001/media/renderers/video_renderer_impl.cc File media/renderers/video_renderer_impl.cc (right): https://codereview.chromium.org/1247973002/diff/20001/media/renderers/video_renderer_impl.cc#newcode225 media/renderers/video_renderer_impl.cc:225: // MaybeStopSinkAfterFirstPaint() runs and the next Render() call ...
5 years, 5 months ago (2015-07-22 00:47:00 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1247973002/20001
5 years, 5 months ago (2015-07-22 00:56:46 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 5 months ago (2015-07-22 02:06:11 UTC) #9
commit-bot: I haz the power
5 years, 5 months ago (2015-07-22 02:07:01 UTC) #10
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/a10468d1cf8729983532b6b0e2595722ea284fbe
Cr-Commit-Position: refs/heads/master@{#339817}

Powered by Google App Engine
This is Rietveld 408576698