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

Unified Diff: media/audio/audio_output_dispatcher_impl.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_dispatcher_impl.h
diff --git a/media/audio/audio_output_dispatcher_impl.h b/media/audio/audio_output_dispatcher_impl.h
index 97eb46bce0cbbc673639020d004092218b3de313..f96d168b263a959b1e3ec2dce4435b136a0bbb65 100644
--- a/media/audio/audio_output_dispatcher_impl.h
+++ b/media/audio/audio_output_dispatcher_impl.h
@@ -42,24 +42,13 @@ class MEDIA_EXPORT AudioOutputDispatcherImpl : public AudioOutputDispatcher {
const base::TimeDelta& close_delay);
~AudioOutputDispatcherImpl() override;
- // Opens a new physical stream if there are no pending streams in
- // |idle_streams_|. Do not call Close() or Stop() if this method fails.
+ // AudioOutputDispatcher implementation.
+ AudioOutputProxy* CreateStreamProxy() override;
bool OpenStream() override;
-
- // If there are pending streams in |idle_streams_| then it reuses one of
- // them, otherwise creates a new one.
bool StartStream(AudioOutputStream::AudioSourceCallback* callback,
AudioOutputProxy* stream_proxy) override;
-
- // Stops the stream assigned to the specified proxy and moves it into
- // |idle_streams_| for reuse by other proxies.
void StopStream(AudioOutputProxy* stream_proxy) override;
-
void StreamVolumeSet(AudioOutputProxy* stream_proxy, double volume) override;
-
- // Closes |idle_streams_| until the number of |idle_streams_| is equal to the
- // |idle_proxies_| count. If there are no |idle_proxies_| a single stream is
- // kept alive until |close_timer_| fires.
void CloseStream(AudioOutputProxy* stream_proxy) override;
// Returns true if there are any open AudioOutputProxy objects.
@@ -93,6 +82,7 @@ class MEDIA_EXPORT AudioOutputDispatcherImpl : public AudioOutputDispatcher {
AudioStreamIDMap audio_stream_ids_;
int audio_stream_id_;
+ base::WeakPtrFactory<AudioOutputDispatcherImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AudioOutputDispatcherImpl);
};

Powered by Google App Engine
This is Rietveld 408576698