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

Unified Diff: media/audio/audio_output_resampler.h

Issue 2621993002: Makes AudioOutputProxy -> AudioOutputDispatcher reference weak. (Closed)
Patch Set: adds CreateStreamProxy Created 3 years, 11 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/audio/audio_output_resampler.h
diff --git a/media/audio/audio_output_resampler.h b/media/audio/audio_output_resampler.h
index cb516c52bb2d13e45185a342bb763a399e62e62d..cbd9c9e13e1ed37bb7e9710d9ecb6d3a5aa27508 100644
--- a/media/audio/audio_output_resampler.h
+++ b/media/audio/audio_output_resampler.h
@@ -39,6 +39,7 @@ class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher {
~AudioOutputResampler() override;
// AudioOutputDispatcher interface.
+ AudioOutputProxy* CreateStreamProxy() override;
bool OpenStream() override;
bool StartStream(AudioOutputStream::AudioSourceCallback* callback,
AudioOutputProxy* stream_proxy) override;
@@ -62,7 +63,8 @@ class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher {
// Map of outstanding OnMoreDataConverter objects. A new object is created
// on every StartStream() call and destroyed on CloseStream().
- typedef std::map<AudioOutputProxy*, OnMoreDataConverter*> CallbackMap;
+ typedef std::map<AudioOutputProxy*, std::unique_ptr<OnMoreDataConverter>>
+ CallbackMap;
CallbackMap callbacks_;
// Used by AudioOutputDispatcherImpl; kept so we can reinitialize on the fly.
@@ -84,6 +86,7 @@ class MEDIA_EXPORT AudioOutputResampler : public AudioOutputDispatcher {
// to a fake stream indefinitely for transient errors.
base::Timer reinitialize_timer_;
+ base::WeakPtrFactory<AudioOutputResampler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AudioOutputResampler);
};

Powered by Google App Engine
This is Rietveld 408576698