| Index: media/audio/audio_output_proxy.h
|
| diff --git a/media/audio/audio_output_proxy.h b/media/audio/audio_output_proxy.h
|
| index 0b358087348f307db5c98da281417a7048e66d1c..16a062824ea55d81aaf86c00dea8907d9307ef3f 100644
|
| --- a/media/audio/audio_output_proxy.h
|
| +++ b/media/audio/audio_output_proxy.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/compiler_specific.h"
|
| #include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "base/threading/non_thread_safe.h"
|
| #include "media/audio/audio_io.h"
|
| #include "media/base/audio_parameters.h"
|
| @@ -28,7 +29,7 @@ class MEDIA_EXPORT AudioOutputProxy
|
| public NON_EXPORTED_BASE(base::NonThreadSafe) {
|
| public:
|
| // Caller keeps ownership of |dispatcher|.
|
| - explicit AudioOutputProxy(AudioOutputDispatcher* dispatcher);
|
| + explicit AudioOutputProxy(base::WeakPtr<AudioOutputDispatcher> dispatcher);
|
|
|
| // AudioOutputStream interface.
|
| bool Open() override;
|
| @@ -39,7 +40,7 @@ class MEDIA_EXPORT AudioOutputProxy
|
| void Close() override;
|
|
|
| AudioOutputDispatcher* get_dispatcher_for_testing() const {
|
| - return dispatcher_;
|
| + return dispatcher_.get();
|
| }
|
|
|
| private:
|
| @@ -54,7 +55,7 @@ class MEDIA_EXPORT AudioOutputProxy
|
|
|
| ~AudioOutputProxy() override;
|
|
|
| - AudioOutputDispatcher* dispatcher_;
|
| + base::WeakPtr<AudioOutputDispatcher> dispatcher_;
|
| State state_;
|
|
|
| // Need to save volume here, so that we can restore it in case the stream
|
|
|