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

Unified Diff: media/mojo/services/mojo_video_decoder_service.h

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
Index: media/mojo/services/mojo_video_decoder_service.h
diff --git a/media/mojo/services/mojo_video_decoder_service.h b/media/mojo/services/mojo_video_decoder_service.h
index 89836b464ae8307b1ae2ec800c18d99da239cbcb..bbb16cd17a74197a779c74922c86d9a8cc7439c2 100644
--- a/media/mojo/services/mojo_video_decoder_service.h
+++ b/media/mojo/services/mojo_video_decoder_service.h
@@ -37,11 +37,16 @@ class MojoVideoDecoderService : public mojom::VideoDecoder {
void Reset(const ResetCallback& callback) final;
private:
+ // Helper methods so that we can bind them with a weak pointer to avoid
+ // running mojom::VideoDecoder callbacks after connection error happens and
+ // |this| is deleted. It's not safe to run the callbacks after a connection
+ // error.
void OnDecoderInitialized(const InitializeCallback& callback, bool success);
void OnDecoderDecoded(const DecodeCallback& callback, DecodeStatus status);
- void OnDecoderOutput(const scoped_refptr<VideoFrame>& frame);
void OnDecoderReset(const ResetCallback& callback);
+ void OnDecoderOutput(const scoped_refptr<VideoFrame>& frame);
+
mojom::VideoDecoderClientAssociatedPtr client_;
std::unique_ptr<MojoDecoderBufferReader> mojo_decoder_buffer_reader_;
« no previous file with comments | « media/mojo/services/mojo_audio_decoder_service.cc ('k') | media/mojo/services/mojo_video_decoder_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698