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

Unified Diff: media/mojo/clients/mojo_demuxer_stream_impl.h

Issue 2075193002: Fixes use-after-free in MojoDemuxerStreamImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 6 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 | « no previous file | media/mojo/clients/mojo_renderer_impl.h » ('j') | media/mojo/clients/mojo_renderer_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/clients/mojo_demuxer_stream_impl.h
diff --git a/media/mojo/clients/mojo_demuxer_stream_impl.h b/media/mojo/clients/mojo_demuxer_stream_impl.h
index 0d3794897cbf125430187a6820e480af4154a58f..49d97b716ecc659b909ffe339b968e0b2b56764b 100644
--- a/media/mojo/clients/mojo_demuxer_stream_impl.h
+++ b/media/mojo/clients/mojo_demuxer_stream_impl.h
@@ -9,7 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "media/base/demuxer_stream.h"
#include "media/mojo/interfaces/demuxer_stream.mojom.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "mojo/public/cpp/bindings/binding.h"
namespace media {
class DemuxerStream;
@@ -31,12 +31,18 @@ class MojoDemuxerStreamImpl : public mojom::DemuxerStream {
void Read(const ReadCallback& callback) override;
void EnableBitstreamConverter() override;
+ // Sets an error handler that will be called if a connection error occurs on
+ // the bound message pipe.
+ void set_connection_error_handler(const mojo::Closure& error_handler) {
+ binding_.set_connection_error_handler(error_handler);
+ }
+
private:
void OnBufferReady(const ReadCallback& callback,
media::DemuxerStream::Status status,
const scoped_refptr<media::DecoderBuffer>& buffer);
- mojo::StrongBinding<mojom::DemuxerStream> binding_;
+ mojo::Binding<mojom::DemuxerStream> binding_;
// See constructor. We do not own |stream_|.
media::DemuxerStream* stream_;
« no previous file with comments | « no previous file | media/mojo/clients/mojo_renderer_impl.h » ('j') | media/mojo/clients/mojo_renderer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698