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

Issue 2640573002: Remove WebMediaPlayerDelegate null checks (Closed)

Created:
3 years, 11 months ago by tguilbert
Modified:
3 years, 11 months ago
CC:
apacible+watch_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, erickung+watch_chromium.org, feature-media-reviews_chromium.org, jam, miu+watch_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, xjz+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove WebMediaPlayerDelegate null checks As per the bug description and xhwang@, we are currently storing the |delegate_| in WMPI as a weak pointer and null-checking it everywhere. From the bug (and verified with dcheng@ as still being true): HTMLMediaElement is a Blink::SuspendableObject, which will have its contextDestroyed() called when Blink::Document::shutdown() is called, which then destroys WMPI. Document::shutdown() is called before a frame is detached, and the RenderFrameImpl will outlive HTMLMediaElement. Since |delegate_| is owned by the RFI, it is safe to pass |delegate_| as a raw pointer an not null check it. This CL removes the null-checks and stores |delegate_| as a raw pointer instead. BUG=593932 TEST= Ran media UTs on Android and desktop. Ran content UTs on desktop. Review-Url: https://codereview.chromium.org/2640573002 Cr-Commit-Position: refs/heads/master@{#445487} Committed: https://chromium.googlesource.com/chromium/src/+/1bb1c78bef7565222274dd05ba49cfbbed1978ec

Patch Set 1 #

Patch Set 2 : Fixed WMPMS and WMPA #

Total comments: 2

Patch Set 3 : Added lifetime guarantee comment #

Patch Set 4 : Undo accidental delete of WMPI::delegate_ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -102 lines) Patch
M content/renderer/media/android/webmediaplayer_android.h View 1 2 2 chunks +8 lines, -2 lines 0 comments Download
M content/renderer/media/android/webmediaplayer_android.cc View 1 8 chunks +30 lines, -37 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.h View 1 2 2 chunks +9 lines, -2 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.cc View 1 6 chunks +14 lines, -21 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 3 chunks +5 lines, -6 lines 0 comments Download
M media/blink/webmediaplayer_impl.h View 1 2 3 2 chunks +9 lines, -3 lines 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 14 chunks +18 lines, -26 lines 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 2 3 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 35 (22 generated)
tguilbert
clamy@, please OWNER review the one line change in content/* sandersd@, please review changes in ...
3 years, 11 months ago (2017-01-17 22:16:42 UTC) #4
sandersd (OOO until July 31)
lgtm
3 years, 11 months ago (2017-01-17 22:57:30 UTC) #5
DaleCurtis
Remove from WMPA, WMPMS too?
3 years, 11 months ago (2017-01-18 00:02:39 UTC) #7
DaleCurtis
Also I feel like I tried this and it didn't work for some reason, but ...
3 years, 11 months ago (2017-01-18 00:03:13 UTC) #8
watk
I just searched for ActiveDOMObject but it's not a thing? Maybe it got renamed.
3 years, 11 months ago (2017-01-18 01:12:11 UTC) #11
DaleCurtis
https://codereview.chromium.org/2567913002/
3 years, 11 months ago (2017-01-18 01:14:35 UTC) #12
clamy
Thanks! Could you explain a bit more the relationship between the various objects involved. I'm ...
3 years, 11 months ago (2017-01-18 13:56:16 UTC) #18
tguilbert
I added comments about the lifetime guarantees, thanks to dcheng@'s explanations. https://codereview.chromium.org/2640573002/diff/20001/content/renderer/media/android/webmediaplayer_android.h File content/renderer/media/android/webmediaplayer_android.h (right): ...
3 years, 11 months ago (2017-01-19 02:39:12 UTC) #22
DaleCurtis
lgtm \o/ fingers crossed. I feel like blink bots exploded locally when I tried this.
3 years, 11 months ago (2017-01-19 22:36:10 UTC) #25
tguilbert
Friendly ping :)
3 years, 11 months ago (2017-01-20 23:01:42 UTC) #28
clamy
Thanks! Lgtm.
3 years, 11 months ago (2017-01-23 13:52:41 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2640573002/100001
3 years, 11 months ago (2017-01-23 19:38:14 UTC) #32
commit-bot: I haz the power
3 years, 11 months ago (2017-01-23 21:15:52 UTC) #35
Message was sent while issue was closed.
Committed patchset #4 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/1bb1c78bef7565222274dd05ba49...

Powered by Google App Engine
This is Rietveld 408576698