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

Unified Diff: media/mojo/clients/mojo_audio_decoder.cc

Issue 2330273002: media: Use associated interface for mojo AudioDecoderClient (Closed)
Patch Set: Created 4 years, 3 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 | « media/mojo/clients/mojo_audio_decoder.h ('k') | media/mojo/interfaces/audio_decoder.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/clients/mojo_audio_decoder.cc
diff --git a/media/mojo/clients/mojo_audio_decoder.cc b/media/mojo/clients/mojo_audio_decoder.cc
index 5393e0564aadd9d6403079965dc466e86ed20632..0d211836f24702e45eb66fc8fc905336298649e1 100644
--- a/media/mojo/clients/mojo_audio_decoder.cc
+++ b/media/mojo/clients/mojo_audio_decoder.cc
@@ -24,7 +24,7 @@ MojoAudioDecoder::MojoAudioDecoder(
mojom::AudioDecoderPtr remote_decoder)
: task_runner_(task_runner),
remote_decoder_info_(remote_decoder.PassInterface()),
- binding_(this),
+ client_binding_(this),
has_connection_error_(false),
needs_bitstream_conversion_(false) {
DVLOG(1) << __FUNCTION__;
@@ -67,11 +67,14 @@ void MojoAudioDecoder::Initialize(const AudioDecoderConfig& config,
init_cb_ = init_cb;
output_cb_ = output_cb;
+ mojom::AudioDecoderClientAssociatedPtrInfo client_ptr_info;
+ client_binding_.Bind(&client_ptr_info, remote_decoder_.associated_group());
+
// Using base::Unretained(this) is safe because |this| owns |remote_decoder_|,
// and the callback won't be dispatched if |remote_decoder_| is destroyed.
remote_decoder_->Initialize(
- binding_.CreateInterfacePtrAndBind(),
- mojom::AudioDecoderConfig::From(config), cdm_id,
+ std::move(client_ptr_info), mojom::AudioDecoderConfig::From(config),
+ cdm_id,
base::Bind(&MojoAudioDecoder::OnInitialized, base::Unretained(this)));
}
« no previous file with comments | « media/mojo/clients/mojo_audio_decoder.h ('k') | media/mojo/interfaces/audio_decoder.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698