This is a preparation CL to Onion souping
content/renderer/media_capture_from_element/.
The goal here is for this directory not depend directly
on //media/blink classes, given that no code in Blink depends
on it neither.
For such, this CL changes blink::WebMediaPlayer derived class
(namely media::WebMediaPlayerImpl and content::WebMediaPlayerMS) to
stop inheriting from base::SupportsWeakPtr<T>, and instead hold an ivar
base::WeakPtrFactory ivar.
CL also adds a pure virtual AsWeakPtr() method to blink::WebMediaPlayer
so its descendant can implement it accordingly.
This way, code in content/renderer/media_capture_from_element/ does
not need to static_cast from blink::WebMediaPlayer to media::WebMediaPlayerImpl
just to call its AsWeakPtr() method, eliminating the need to reference
//media/blink/webmediaplayer_impl.h directly from there.
No functionality change.
BUG=787261
Change-Id: Ib41fef1b07b6a10f70cd02d90506cd76e08fb586
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611781
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660201}