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_; |