Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index 66c81ece0095c5d9486cc4cddd1ad14f7ff6012f..096997042ba104fc3b2d6947e06f55c138da8e5f 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -648,6 +648,8 @@ |
kMaxResourceRequestsPerFlushWhenThrottled)); |
resource_dispatcher()->set_message_sender(resource_dispatch_throttler_.get()); |
+ media_stream_center_ = nullptr; |
+ |
blob_message_filter_ = new BlobMessageFilter(GetFileThreadTaskRunner()); |
AddFilter(blob_message_filter_.get()); |
db_message_filter_ = new DBMessageFilter(); |
@@ -1982,22 +1984,20 @@ |
return layout_test_deps_->RequestCopyOfOutput(routing_id, std::move(request)); |
} |
-std::unique_ptr<blink::WebMediaStreamCenter> |
-RenderThreadImpl::CreateMediaStreamCenter( |
+blink::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( |
blink::WebMediaStreamCenterClient* client) { |
- std::unique_ptr<blink::WebMediaStreamCenter> media_stream_center; |
#if BUILDFLAG(ENABLE_WEBRTC) |
- if (!media_stream_center) { |
- media_stream_center = |
- GetContentClient()->renderer()->OverrideCreateWebMediaStreamCenter( |
- client); |
- if (!media_stream_center) { |
- media_stream_center = base::MakeUnique<MediaStreamCenter>( |
- client, GetPeerConnectionDependencyFactory()); |
+ if (!media_stream_center_) { |
+ media_stream_center_ = GetContentClient()->renderer() |
+ ->OverrideCreateWebMediaStreamCenter(client); |
+ if (!media_stream_center_) { |
+ std::unique_ptr<MediaStreamCenter> media_stream_center( |
+ new MediaStreamCenter(client, GetPeerConnectionDependencyFactory())); |
+ media_stream_center_ = media_stream_center.release(); |
} |
} |
#endif |
- return media_stream_center; |
+ return media_stream_center_; |
} |
#if BUILDFLAG(ENABLE_WEBRTC) |