Eliminate html_video_element_capturer_source.cc dependency on media/blink/webmediaplayer_impl.h
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}
This commit is contained in:

committed by
Commit Bot

parent
a66a2fbceb
commit
142f32a209
content/renderer
media
media_capture_from_element
media/blink
third_party/blink
@ -265,10 +265,12 @@ WebMediaPlayerMS::WebMediaPlayerMS(
|
||||
should_play_upon_shown_(false),
|
||||
create_bridge_callback_(std::move(create_bridge_callback)),
|
||||
submitter_(std::move(submitter)),
|
||||
surface_layer_mode_(surface_layer_mode) {
|
||||
surface_layer_mode_(surface_layer_mode),
|
||||
weak_factory_(this) {
|
||||
DVLOG(1) << __func__;
|
||||
DCHECK(client);
|
||||
DCHECK(delegate_);
|
||||
weak_this_ = weak_factory_.GetWeakPtr();
|
||||
delegate_id_ = delegate_->AddObserver(this);
|
||||
|
||||
media_log_->AddEvent(
|
||||
@ -325,7 +327,7 @@ blink::WebMediaPlayer::LoadTiming WebMediaPlayerMS::Load(
|
||||
|
||||
compositor_ = new WebMediaPlayerMSCompositor(
|
||||
compositor_task_runner_, io_task_runner_, web_stream_,
|
||||
std::move(submitter_), surface_layer_mode_, AsWeakPtr());
|
||||
std::move(submitter_), surface_layer_mode_, weak_this_);
|
||||
|
||||
SetNetworkState(WebMediaPlayer::kNetworkStateLoading);
|
||||
SetReadyState(WebMediaPlayer::kReadyStateHaveNothing);
|
||||
@ -334,7 +336,7 @@ blink::WebMediaPlayer::LoadTiming WebMediaPlayerMS::Load(
|
||||
media_log_->AddEvent(media_log_->CreateLoadEvent(stream_id));
|
||||
|
||||
frame_deliverer_.reset(new WebMediaPlayerMS::FrameDeliverer(
|
||||
AsWeakPtr(),
|
||||
weak_this_,
|
||||
base::BindRepeating(&WebMediaPlayerMSCompositor::EnqueueFrame,
|
||||
compositor_),
|
||||
media_task_runner_, worker_task_runner_, gpu_factories_));
|
||||
@ -466,6 +468,10 @@ base::Optional<viz::SurfaceId> WebMediaPlayerMS::GetSurfaceId() {
|
||||
return base::nullopt;
|
||||
}
|
||||
|
||||
base::WeakPtr<blink::WebMediaPlayer> WebMediaPlayerMS::AsWeakPtr() {
|
||||
return weak_this_;
|
||||
}
|
||||
|
||||
void WebMediaPlayerMS::Reload() {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
if (web_stream_.IsNull())
|
||||
|
@ -74,8 +74,7 @@ class CONTENT_EXPORT WebMediaPlayerMS
|
||||
: public blink::WebMediaStreamObserver,
|
||||
public blink::WebMediaPlayer,
|
||||
public media::WebMediaPlayerDelegate::Observer,
|
||||
public blink::WebSurfaceLayerBridgeObserver,
|
||||
public base::SupportsWeakPtr<WebMediaPlayerMS> {
|
||||
public blink::WebSurfaceLayerBridgeObserver {
|
||||
public:
|
||||
// Construct a WebMediaPlayerMS with reference to the client, and
|
||||
// a MediaStreamClient which provides blink::WebMediaStreamVideoRenderer.
|
||||
@ -236,6 +235,8 @@ class CONTENT_EXPORT WebMediaPlayerMS
|
||||
int GetDelegateId() override;
|
||||
base::Optional<viz::SurfaceId> GetSurfaceId() override;
|
||||
|
||||
base::WeakPtr<blink::WebMediaPlayer> AsWeakPtr() override;
|
||||
|
||||
void OnDisplayTypeChanged(WebMediaPlayer::DisplayType) override;
|
||||
|
||||
private:
|
||||
@ -357,6 +358,9 @@ class CONTENT_EXPORT WebMediaPlayerMS
|
||||
// Whether the video is known to be opaque or not.
|
||||
bool opaque_ = true;
|
||||
|
||||
base::WeakPtr<WebMediaPlayerMS> weak_this_;
|
||||
base::WeakPtrFactory<WebMediaPlayerMS> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS);
|
||||
};
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "media/base/audio_parameters.h"
|
||||
#include "media/base/audio_renderer_sink.h"
|
||||
#include "media/blink/webaudiosourceprovider_impl.h"
|
||||
#include "media/blink/webmediaplayer_impl.h"
|
||||
#include "third_party/blink/public/platform/web_media_player.h"
|
||||
|
||||
namespace content {
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "cc/paint/skia_paint_canvas.h"
|
||||
#include "content/public/renderer/render_thread.h"
|
||||
#include "media/base/limits.h"
|
||||
#include "media/blink/webmediaplayer_impl.h"
|
||||
#include "skia/ext/platform_canvas.h"
|
||||
#include "third_party/blink/public/platform/modules/mediastream/webrtc_uma_histograms.h"
|
||||
#include "third_party/blink/public/platform/web_media_player.h"
|
||||
@ -38,9 +37,9 @@ HtmlVideoElementCapturerSource::CreateFromWebMediaPlayerImpl(
|
||||
// The histogram counts the number of calls to the JS API.
|
||||
UpdateWebRTCMethodCount(blink::WebRTCAPIName::kVideoCaptureStream);
|
||||
|
||||
// TODO(crbug.com/963651): Remove the need for AsWeakPtr altogether.
|
||||
return base::WrapUnique(new HtmlVideoElementCapturerSource(
|
||||
static_cast<media::WebMediaPlayerImpl*>(player)->AsWeakPtr(),
|
||||
io_task_runner, task_runner));
|
||||
player->AsWeakPtr(), io_task_runner, task_runner));
|
||||
}
|
||||
|
||||
HtmlVideoElementCapturerSource::HtmlVideoElementCapturerSource(
|
||||
|
@ -34,10 +34,9 @@ ACTION_P(RunClosure, closure) {
|
||||
}
|
||||
|
||||
// An almost empty WebMediaPlayer to override paint() method.
|
||||
class MockWebMediaPlayer : public blink::WebMediaPlayer,
|
||||
public base::SupportsWeakPtr<MockWebMediaPlayer> {
|
||||
class MockWebMediaPlayer : public blink::WebMediaPlayer {
|
||||
public:
|
||||
MockWebMediaPlayer() = default;
|
||||
MockWebMediaPlayer() : weak_factory_(this) {}
|
||||
~MockWebMediaPlayer() override = default;
|
||||
|
||||
LoadTiming Load(LoadType,
|
||||
@ -97,7 +96,13 @@ class MockWebMediaPlayer : public blink::WebMediaPlayer,
|
||||
}
|
||||
bool IsOpaque() const override { return is_video_opaque_; }
|
||||
|
||||
base::WeakPtr<WebMediaPlayer> AsWeakPtr() override {
|
||||
return weak_factory_.GetWeakPtr();
|
||||
}
|
||||
|
||||
bool is_video_opaque_ = true;
|
||||
|
||||
base::WeakPtrFactory<MockWebMediaPlayer> weak_factory_;
|
||||
};
|
||||
|
||||
class HTMLVideoElementCapturerSourceTest : public testing::TestWithParam<bool> {
|
||||
|
@ -314,28 +314,30 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
|
||||
is_background_video_playback_enabled_(
|
||||
params->IsBackgroundVideoPlaybackEnabled()),
|
||||
is_background_video_track_optimization_supported_(
|
||||
params->IsBackgroundVideoTrackOptimizationSupported()) {
|
||||
params->IsBackgroundVideoTrackOptimizationSupported()),
|
||||
weak_factory_(this) {
|
||||
DVLOG(1) << __func__;
|
||||
DCHECK(adjust_allocated_memory_cb_);
|
||||
DCHECK(renderer_factory_selector_);
|
||||
DCHECK(client_);
|
||||
DCHECK(delegate_);
|
||||
|
||||
weak_this_ = weak_factory_.GetWeakPtr();
|
||||
|
||||
pipeline_controller_ = std::make_unique<PipelineController>(
|
||||
std::make_unique<PipelineImpl>(media_task_runner_, main_task_runner_,
|
||||
media_log_.get()),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::CreateRenderer,
|
||||
base::Unretained(this)),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnPipelineSeeked, AsWeakPtr()),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnPipelineSuspended,
|
||||
AsWeakPtr()),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnPipelineSeeked, weak_this_),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnPipelineSuspended, weak_this_),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnBeforePipelineResume,
|
||||
AsWeakPtr()),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnPipelineResumed, AsWeakPtr()),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnError, AsWeakPtr()));
|
||||
weak_this_),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnPipelineResumed, weak_this_),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnError, weak_this_));
|
||||
|
||||
buffered_data_source_host_ = std::make_unique<BufferedDataSourceHostImpl>(
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnProgress, AsWeakPtr()),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnProgress, weak_this_),
|
||||
tick_clock_);
|
||||
|
||||
// If we're supposed to force video overlays, then make sure that they're
|
||||
@ -487,7 +489,7 @@ WebMediaPlayer::LoadTiming WebMediaPlayerImpl::Load(
|
||||
|
||||
if (defer_load_cb_) {
|
||||
is_deferred = defer_load_cb_.Run(base::BindOnce(
|
||||
&WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode));
|
||||
&WebMediaPlayerImpl::DoLoad, weak_this_, load_type, url, cors_mode));
|
||||
} else {
|
||||
DoLoad(load_type, url, cors_mode);
|
||||
}
|
||||
@ -532,7 +534,7 @@ void WebMediaPlayerImpl::EnableOverlay() {
|
||||
overlay_mode_ == OverlayMode::kUseAndroidOverlay) {
|
||||
overlay_routing_token_is_pending_ = true;
|
||||
token_available_cb_.Reset(
|
||||
base::Bind(&WebMediaPlayerImpl::OnOverlayRoutingToken, AsWeakPtr()));
|
||||
base::Bind(&WebMediaPlayerImpl::OnOverlayRoutingToken, weak_this_));
|
||||
request_routing_token_cb_.Run(token_available_cb_.callback());
|
||||
}
|
||||
|
||||
@ -728,18 +730,18 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type,
|
||||
auto url_data =
|
||||
url_index_->GetByUrl(url, static_cast<UrlData::CorsMode>(cors_mode));
|
||||
// Notify |this| of bytes received by the network.
|
||||
url_data->AddBytesReceivedCallback(BindToCurrentLoop(base::BindRepeating(
|
||||
&WebMediaPlayerImpl::OnBytesReceived, AsWeakPtr())));
|
||||
url_data->AddBytesReceivedCallback(BindToCurrentLoop(
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnBytesReceived, weak_this_)));
|
||||
mb_data_source_ = new MultibufferDataSource(
|
||||
main_task_runner_, std::move(url_data), media_log_.get(),
|
||||
buffered_data_source_host_.get(),
|
||||
base::BindRepeating(&WebMediaPlayerImpl::NotifyDownloading,
|
||||
AsWeakPtr()));
|
||||
weak_this_));
|
||||
data_source_.reset(mb_data_source_);
|
||||
mb_data_source_->SetPreload(preload_);
|
||||
mb_data_source_->SetIsClientAudioElement(client_->IsAudioElement());
|
||||
mb_data_source_->Initialize(
|
||||
base::Bind(&WebMediaPlayerImpl::DataSourceInitialized, AsWeakPtr()));
|
||||
base::Bind(&WebMediaPlayerImpl::DataSourceInitialized, weak_this_));
|
||||
}
|
||||
}
|
||||
|
||||
@ -848,7 +850,7 @@ void WebMediaPlayerImpl::DoSeek(base::TimeDelta time, bool time_updated) {
|
||||
if (old_state == kReadyStateHaveEnoughData) {
|
||||
main_task_runner_->PostTask(
|
||||
FROM_HERE, base::BindOnce(&WebMediaPlayerImpl::OnBufferingStateChange,
|
||||
AsWeakPtr(), BUFFERING_HAVE_ENOUGH));
|
||||
weak_this_, BUFFERING_HAVE_ENOUGH));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1469,7 +1471,7 @@ void WebMediaPlayerImpl::SetCdmInternal(
|
||||
// after the pipeline is done with the |cdm_context|.
|
||||
pending_cdm_context_ref_ = std::move(cdm_context_ref);
|
||||
pipeline_controller_->SetCdm(
|
||||
cdm_context, base::Bind(&WebMediaPlayerImpl::OnCdmAttached, AsWeakPtr()));
|
||||
cdm_context, base::Bind(&WebMediaPlayerImpl::OnCdmAttached, weak_this_));
|
||||
}
|
||||
|
||||
void WebMediaPlayerImpl::OnCdmAttached(bool success) {
|
||||
@ -1705,7 +1707,7 @@ void WebMediaPlayerImpl::OnError(PipelineStatus status) {
|
||||
std::move(start_pipeline_cb).Run();
|
||||
},
|
||||
std::move(demuxer_), std::move(data_source_),
|
||||
base::BindOnce(&WebMediaPlayerImpl::StartPipeline, AsWeakPtr()))));
|
||||
base::BindOnce(&WebMediaPlayerImpl::StartPipeline, weak_this_))));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -2292,7 +2294,7 @@ void WebMediaPlayerImpl::OnFrameShown() {
|
||||
if ((!paused_ && IsBackgroundOptimizationCandidate()) ||
|
||||
paused_when_hidden_) {
|
||||
frame_time_report_cb_.Reset(base::BindOnce(
|
||||
&WebMediaPlayerImpl::ReportTimeFromForegroundToFirstFrame, AsWeakPtr(),
|
||||
&WebMediaPlayerImpl::ReportTimeFromForegroundToFirstFrame, weak_this_,
|
||||
base::TimeTicks::Now()));
|
||||
vfc_task_runner_->PostTask(
|
||||
FROM_HERE,
|
||||
@ -2567,7 +2569,7 @@ std::unique_ptr<Renderer> WebMediaPlayerImpl::CreateRenderer() {
|
||||
RequestOverlayInfoCB request_overlay_info_cb;
|
||||
#if defined(OS_ANDROID)
|
||||
request_overlay_info_cb = BindToCurrentLoop(
|
||||
base::Bind(&WebMediaPlayerImpl::OnOverlayInfoRequested, AsWeakPtr()));
|
||||
base::Bind(&WebMediaPlayerImpl::OnOverlayInfoRequested, weak_this_));
|
||||
#endif
|
||||
return renderer_factory_selector_->GetCurrentFactory()->CreateRenderer(
|
||||
media_task_runner_, worker_task_runner_, audio_source_provider_.get(),
|
||||
@ -2579,14 +2581,14 @@ void WebMediaPlayerImpl::StartPipeline() {
|
||||
|
||||
Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb =
|
||||
BindToCurrentLoop(base::Bind(
|
||||
&WebMediaPlayerImpl::OnEncryptedMediaInitData, AsWeakPtr()));
|
||||
&WebMediaPlayerImpl::OnEncryptedMediaInitData, weak_this_));
|
||||
|
||||
vfc_task_runner_->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&VideoFrameCompositor::SetOnNewProcessedFrameCallback,
|
||||
base::Unretained(compositor_.get()),
|
||||
BindToCurrentLoop(base::BindOnce(
|
||||
&WebMediaPlayerImpl::OnFirstFrame, AsWeakPtr()))));
|
||||
&WebMediaPlayerImpl::OnFirstFrame, weak_this_))));
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
if (demuxer_found_hls_ ||
|
||||
@ -2617,7 +2619,7 @@ void WebMediaPlayerImpl::StartPipeline() {
|
||||
#if BUILDFLAG(ENABLE_FFMPEG)
|
||||
Demuxer::MediaTracksUpdatedCB media_tracks_updated_cb =
|
||||
BindToCurrentLoop(base::Bind(
|
||||
&WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated, AsWeakPtr()));
|
||||
&WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated, weak_this_));
|
||||
|
||||
demuxer_.reset(new FFmpegDemuxer(
|
||||
media_task_runner_, data_source_.get(), encrypted_media_init_data_cb,
|
||||
@ -2630,16 +2632,15 @@ void WebMediaPlayerImpl::StartPipeline() {
|
||||
DCHECK(!chunk_demuxer_);
|
||||
DCHECK(!data_source_);
|
||||
|
||||
chunk_demuxer_ = new ChunkDemuxer(
|
||||
BindToCurrentLoop(
|
||||
base::Bind(&WebMediaPlayerImpl::OnDemuxerOpened, AsWeakPtr())),
|
||||
BindToCurrentLoop(
|
||||
base::Bind(&WebMediaPlayerImpl::OnProgress, AsWeakPtr())),
|
||||
encrypted_media_init_data_cb, media_log_.get());
|
||||
chunk_demuxer_ =
|
||||
new ChunkDemuxer(BindToCurrentLoop(base::Bind(
|
||||
&WebMediaPlayerImpl::OnDemuxerOpened, weak_this_)),
|
||||
BindToCurrentLoop(base::Bind(
|
||||
&WebMediaPlayerImpl::OnProgress, weak_this_)),
|
||||
encrypted_media_init_data_cb, media_log_.get());
|
||||
// Notify |this| of bytes that are received via MSE.
|
||||
chunk_demuxer_->AddBytesReceivedCallback(
|
||||
BindToCurrentLoop(base::BindRepeating(
|
||||
&WebMediaPlayerImpl::OnBytesReceived, AsWeakPtr())));
|
||||
chunk_demuxer_->AddBytesReceivedCallback(BindToCurrentLoop(
|
||||
base::BindRepeating(&WebMediaPlayerImpl::OnBytesReceived, weak_this_)));
|
||||
demuxer_.reset(chunk_demuxer_);
|
||||
|
||||
if (base::FeatureList::IsEnabled(kMemoryPressureBasedSourceBufferGC)) {
|
||||
@ -2975,7 +2976,7 @@ void WebMediaPlayerImpl::ReportMemoryUsage() {
|
||||
base::PostTaskAndReplyWithResult(
|
||||
media_task_runner_.get(), FROM_HERE,
|
||||
base::Bind(&Demuxer::GetMemoryUsage, base::Unretained(demuxer_.get())),
|
||||
base::Bind(&WebMediaPlayerImpl::FinishMemoryUsageReport, AsWeakPtr()));
|
||||
base::Bind(&WebMediaPlayerImpl::FinishMemoryUsageReport, weak_this_));
|
||||
} else {
|
||||
FinishMemoryUsageReport(0);
|
||||
}
|
||||
@ -3183,6 +3184,10 @@ base::Optional<viz::SurfaceId> WebMediaPlayerImpl::GetSurfaceId() {
|
||||
return bridge_->GetSurfaceId();
|
||||
}
|
||||
|
||||
base::WeakPtr<blink::WebMediaPlayer> WebMediaPlayerImpl::AsWeakPtr() {
|
||||
return weak_this_;
|
||||
}
|
||||
|
||||
bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
|
||||
// Audio only stream is allowed to play when in background.
|
||||
// TODO: We should check IsBackgroundOptimizationCandidate here. But we need
|
||||
|
@ -89,8 +89,7 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
||||
public WebMediaPlayerDelegate::Observer,
|
||||
public Pipeline::Client,
|
||||
public MediaObserverClient,
|
||||
public blink::WebSurfaceLayerBridgeObserver,
|
||||
public base::SupportsWeakPtr<WebMediaPlayerImpl> {
|
||||
public blink::WebSurfaceLayerBridgeObserver {
|
||||
public:
|
||||
// Constructs a WebMediaPlayer implementation using Chromium's media stack.
|
||||
// |delegate| and |renderer_factory_selector| must not be null.
|
||||
@ -271,6 +270,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
||||
int GetDelegateId() override;
|
||||
base::Optional<viz::SurfaceId> GetSurfaceId() override;
|
||||
|
||||
base::WeakPtr<blink::WebMediaPlayer> AsWeakPtr() override;
|
||||
|
||||
bool IsBackgroundMediaSuspendEnabled() const {
|
||||
return is_background_suspend_enabled_;
|
||||
}
|
||||
@ -970,6 +971,9 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
||||
// Whether background video optimization is supported on current platform.
|
||||
bool is_background_video_track_optimization_supported_ = true;
|
||||
|
||||
base::WeakPtr<WebMediaPlayerImpl> weak_this_;
|
||||
base::WeakPtrFactory<WebMediaPlayerImpl> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
|
||||
};
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_MEDIA_PLAYER_H_
|
||||
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_MEDIA_PLAYER_H_
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/time/time.h"
|
||||
#include "components/viz/common/surfaces/surface_id.h"
|
||||
#include "third_party/blink/public/platform/web_callbacks.h"
|
||||
@ -418,6 +419,8 @@ class WebMediaPlayer {
|
||||
virtual base::Optional<viz::SurfaceId> GetSurfaceId() {
|
||||
return base::nullopt;
|
||||
}
|
||||
|
||||
virtual base::WeakPtr<WebMediaPlayer> AsWeakPtr() = 0;
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
@ -61,6 +61,7 @@ class EmptyWebMediaPlayer : public WebMediaPlayer {
|
||||
cc::PaintFlags&,
|
||||
int already_uploaded_id,
|
||||
VideoFrameUploadMetadata*) override {}
|
||||
base::WeakPtr<WebMediaPlayer> AsWeakPtr() override { return nullptr; }
|
||||
};
|
||||
|
||||
} // namespace blink
|
||||
|
Reference in New Issue
Block a user