summaryrefslogtreecommitdiff
path: root/chromium/media/renderers/default_decoder_factory.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/renderers/default_decoder_factory.h')
-rw-r--r--chromium/media/renderers/default_decoder_factory.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/chromium/media/renderers/default_decoder_factory.h b/chromium/media/renderers/default_decoder_factory.h
index 1b1305d3617..cb471dc3fb3 100644
--- a/chromium/media/renderers/default_decoder_factory.h
+++ b/chromium/media/renderers/default_decoder_factory.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "base/synchronization/lock.h"
#include "media/base/decoder_factory.h"
#include "media/base/media_export.h"
@@ -33,9 +34,16 @@ class MEDIA_EXPORT DefaultDecoderFactory : public DecoderFactory {
const gfx::ColorSpace& target_color_space,
std::vector<std::unique_ptr<VideoDecoder>>* video_decoders) final;
+ // Called from the renderer thread to prevent any more decoders from being
+ // vended on other threads.
+ void Shutdown();
+
private:
- std::unique_ptr<DecoderFactory> external_decoder_factory_;
+ base::Lock shutdown_lock_;
+ bool is_shutdown_ GUARDED_BY(shutdown_lock_) = false;
+ std::unique_ptr<DecoderFactory> external_decoder_factory_
+ GUARDED_BY(shutdown_lock_);
DISALLOW_COPY_AND_ASSIGN(DefaultDecoderFactory);
};