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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2846843002: [blink] Unique pointers in Platform.h (Closed)
Patch Set: fix compilation (and again) Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/renderer_blink_platform_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 071e3934a010bac91078ce764f56783c4486f904..3cd25f1ebba73068fdcfec0e57e0bcb32d4fc927 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -651,8 +651,6 @@ void RenderThreadImpl::Init(
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();
@@ -1980,20 +1978,22 @@ RenderThreadImpl::RequestCopyOfOutputForLayoutTest(
return layout_test_deps_->RequestCopyOfOutput(routing_id, std::move(request));
}
-blink::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter(
+std::unique_ptr<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_) {
- std::unique_ptr<MediaStreamCenter> media_stream_center(
- new MediaStreamCenter(client, GetPeerConnectionDependencyFactory()));
- media_stream_center_ = media_stream_center.release();
+ if (!media_stream_center) {
+ media_stream_center =
+ GetContentClient()->renderer()->OverrideCreateWebMediaStreamCenter(
+ client);
+ if (!media_stream_center) {
+ media_stream_center = base::MakeUnique<MediaStreamCenter>(
+ client, GetPeerConnectionDependencyFactory());
}
}
#endif
- return media_stream_center_;
+ return media_stream_center;
}
#if BUILDFLAG(ENABLE_WEBRTC)
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/renderer_blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698