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

Unified Diff: media/mojo/services/mojo_audio_decoder_service.cc

Issue 2408063009: media: Use native DecodeStatus in media mojo interfaces (Closed)
Patch Set: comments addressed Created 4 years, 2 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/interfaces/media_types.typemap ('k') | media/mojo/services/mojo_video_decoder_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_audio_decoder_service.cc
diff --git a/media/mojo/services/mojo_audio_decoder_service.cc b/media/mojo/services/mojo_audio_decoder_service.cc
index 0e0fd154c3eabb7df954904451487babee06acfa..039cb5db00f2ebcd244ea545e804407930095d76 100644
--- a/media/mojo/services/mojo_audio_decoder_service.cc
+++ b/media/mojo/services/mojo_audio_decoder_service.cc
@@ -83,7 +83,7 @@ void MojoAudioDecoderService::Decode(mojom::DecoderBufferPtr buffer,
scoped_refptr<DecoderBuffer> media_buffer =
mojo_decoder_buffer_reader_->ReadDecoderBuffer(buffer);
if (!media_buffer) {
- callback.Run(mojom::DecodeStatus::DECODE_ERROR);
+ callback.Run(DecodeStatus::DECODE_ERROR);
return;
}
@@ -112,10 +112,14 @@ void MojoAudioDecoderService::OnInitialized(const InitializeCallback& callback,
}
}
+// These two methods are needed so that we can bind them with a weak pointer to
+// avoid running the |callback| after connection error happens and |this| is
+// deleted. It's not safe to run the |callback| after a connection error.
+
void MojoAudioDecoderService::OnDecodeStatus(const DecodeCallback& callback,
media::DecodeStatus status) {
DVLOG(3) << __FUNCTION__ << " status:" << status;
- callback.Run(static_cast<mojom::DecodeStatus>(status));
+ callback.Run(status);
}
void MojoAudioDecoderService::OnResetDone(const ResetCallback& callback) {
« no previous file with comments | « media/mojo/interfaces/media_types.typemap ('k') | media/mojo/services/mojo_video_decoder_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698