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

Issue 2011653002: Close bitstream buffer shared memory handles on Android. (Closed)

Created:
4 years, 7 months ago by liberato (no reviews please)
Modified:
4 years, 7 months ago
Reviewers:
watk, DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org, piman+watch_chromium.org, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Close bitstream buffer shared memory handles on Android. AndroidVideoDecodeAccelerator would clear references to pending bitstream buffers in ::Reset and, implicitly, in the destructor. However, each of those may have a file descriptor for shared memory that isn't closed. During a seek, for example, this can cause leaks. This CL wraps the queue of pending bitstream buffers with a new BitstreamRecord type, which has a unique_ptr to the (unmapped) shared memory region, if any. This will automatically close the underlying handle when the unique_ptr is released. Note that no expensive operation is performed in creating the shared memory region. Unless it is later mapped, it just keeps the handle and ::close()s it on destruction. BUG=614489 TEST=observed /proc/fd/[gpu process] while seeking in a video Committed: https://crrev.com/6e41c76f8bb74142e5a484f3ee6f6a87119b12fb Cr-Commit-Position: refs/heads/master@{#395985}

Patch Set 1 #

Total comments: 2

Patch Set 2 : RAII #

Patch Set 3 : moved BitstreamRecord code higher in avda.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -18 lines) Patch
M media/gpu/android_video_decode_accelerator.h View 1 2 chunks +17 lines, -1 line 0 comments Download
M media/gpu/android_video_decode_accelerator.cc View 1 2 9 chunks +32 lines, -17 lines 0 comments Download

Messages

Total messages: 15 (5 generated)
liberato (no reviews please)
yay for leaks. on my n7 / lollipop, it's been seeking 3x videos for several ...
4 years, 7 months ago (2016-05-24 21:40:50 UTC) #3
watk
https://codereview.chromium.org/2011653002/diff/1/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2011653002/diff/1/media/gpu/android_video_decode_accelerator.cc#newcode1524 media/gpu/android_video_decode_accelerator.cc:1524: new SharedMemoryRegion(bitstream_buffer, true)); We were thinking it might be ...
4 years, 7 months ago (2016-05-24 22:16:07 UTC) #4
liberato (no reviews please)
https://codereview.chromium.org/2011653002/diff/1/media/gpu/android_video_decode_accelerator.cc File media/gpu/android_video_decode_accelerator.cc (right): https://codereview.chromium.org/2011653002/diff/1/media/gpu/android_video_decode_accelerator.cc#newcode1524 media/gpu/android_video_decode_accelerator.cc:1524: new SharedMemoryRegion(bitstream_buffer, true)); On 2016/05/24 22:16:07, watk wrote: > ...
4 years, 7 months ago (2016-05-24 23:19:26 UTC) #5
liberato (no reviews please)
this has watk's RAII suggestion. i've tested it via chromoting, and it appears like it ...
4 years, 7 months ago (2016-05-25 13:47:48 UTC) #6
DaleCurtis
lgtm
4 years, 7 months ago (2016-05-25 19:16:30 UTC) #7
watk
Nice, the description is a bit out of date now btw. lgtm
4 years, 7 months ago (2016-05-25 20:07:44 UTC) #8
liberato (no reviews please)
On 2016/05/25 20:07:44, watk wrote: > Nice, the description is a bit out of date ...
4 years, 7 months ago (2016-05-25 20:47:46 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2011653002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2011653002/20001
4 years, 7 months ago (2016-05-25 20:48:11 UTC) #12
commit-bot: I haz the power
Committed patchset #3 (id:20001)
4 years, 7 months ago (2016-05-25 20:52:35 UTC) #13
commit-bot: I haz the power
4 years, 7 months ago (2016-05-25 20:54:03 UTC) #15
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/6e41c76f8bb74142e5a484f3ee6f6a87119b12fb
Cr-Commit-Position: refs/heads/master@{#395985}

Powered by Google App Engine
This is Rietveld 408576698