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

Side by Side Diff: media/mojo/services/mojo_renderer_impl.cc

Issue 1635603002: Make use of CreateInterfacePtrAndBind() where appropriate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « media/mojo/services/mojo_cdm.cc ('k') | mojo/services/network/network_service_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mojo/services/mojo_renderer_impl.h" 5 #include "media/mojo/services/mojo_renderer_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); 61 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO);
62 62
63 interfaces::DemuxerStreamPtr audio_stream; 63 interfaces::DemuxerStreamPtr audio_stream;
64 if (audio) 64 if (audio)
65 new MojoDemuxerStreamImpl(audio, GetProxy(&audio_stream)); 65 new MojoDemuxerStreamImpl(audio, GetProxy(&audio_stream));
66 66
67 interfaces::DemuxerStreamPtr video_stream; 67 interfaces::DemuxerStreamPtr video_stream;
68 if (video) 68 if (video)
69 new MojoDemuxerStreamImpl(video, GetProxy(&video_stream)); 69 new MojoDemuxerStreamImpl(video, GetProxy(&video_stream));
70 70
71 interfaces::RendererClientPtr client_ptr;
72 binding_.Bind(GetProxy(&client_ptr));
73 remote_renderer_->Initialize( 71 remote_renderer_->Initialize(
74 std::move(client_ptr), std::move(audio_stream), std::move(video_stream), 72 binding_.CreateInterfacePtrAndBind(), std::move(audio_stream),
73 std::move(video_stream),
75 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, 74 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized,
76 weak_factory_.GetWeakPtr()))); 75 weak_factory_.GetWeakPtr())));
77 } 76 }
78 77
79 void MojoRendererImpl::SetCdm(CdmContext* cdm_context, 78 void MojoRendererImpl::SetCdm(CdmContext* cdm_context,
80 const CdmAttachedCB& cdm_attached_cb) { 79 const CdmAttachedCB& cdm_attached_cb) {
81 DVLOG(1) << __FUNCTION__; 80 DVLOG(1) << __FUNCTION__;
82 DCHECK(task_runner_->BelongsToCurrentThread()); 81 DCHECK(task_runner_->BelongsToCurrentThread());
83 82
84 int32_t cdm_id = cdm_context->GetCdmId(); 83 int32_t cdm_id = cdm_context->GetCdmId();
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 void MojoRendererImpl::OnInitialized(bool success) { 204 void MojoRendererImpl::OnInitialized(bool success) {
206 DVLOG(1) << __FUNCTION__; 205 DVLOG(1) << __FUNCTION__;
207 DCHECK(task_runner_->BelongsToCurrentThread()); 206 DCHECK(task_runner_->BelongsToCurrentThread());
208 DCHECK(!init_cb_.is_null()); 207 DCHECK(!init_cb_.is_null());
209 208
210 base::ResetAndReturn(&init_cb_) 209 base::ResetAndReturn(&init_cb_)
211 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED); 210 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED);
212 } 211 }
213 212
214 } // namespace media 213 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm.cc ('k') | mojo/services/network/network_service_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698