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

Unified Diff: media/mojo/services/mojo_audio_output_stream_provider.h

Issue 2869733005: Convert some audio code to OnceCallback. (Closed)
Patch Set: Rebase, comments on unretained. Created 3 years, 7 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 | « media/audio/audio_system_impl.cc ('k') | media/mojo/services/mojo_audio_output_stream_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_audio_output_stream_provider.h
diff --git a/media/mojo/services/mojo_audio_output_stream_provider.h b/media/mojo/services/mojo_audio_output_stream_provider.h
index 03eeb8d20c811d7ac678ffb57fbeb853ecadb24a..5a1b2f5abe728d901237a4bcf2e0fdd4af81caad 100644
--- a/media/mojo/services/mojo_audio_output_stream_provider.h
+++ b/media/mojo/services/mojo_audio_output_stream_provider.h
@@ -25,7 +25,7 @@ class MEDIA_MOJO_EXPORT MojoAudioOutputStreamProvider
base::OnceCallback<std::unique_ptr<AudioOutputDelegate>(
const AudioParameters& params,
AudioOutputDelegate::EventHandler*)>;
- using DeleterCallback = base::Callback<void(AudioOutputStreamProvider*)>;
+ using DeleterCallback = base::OnceCallback<void(AudioOutputStreamProvider*)>;
// |create_delegate_callback| is used to obtain an AudioOutputDelegate for the
// AudioOutput when it's initialized and |deleter_callback| is called when
@@ -43,13 +43,16 @@ class MEDIA_MOJO_EXPORT MojoAudioOutputStreamProvider
const AudioParameters& params,
const AcquireCallback& acquire_callback) override;
+ // Called when |audio_output_| had an error.
+ void OnError();
+
// The callback for the Acquire() must be stored until the response is ready.
AcquireCallback acquire_callback_;
base::Optional<MojoAudioOutputStream> audio_output_;
mojo::Binding<AudioOutputStreamProvider> binding_;
CreateDelegateCallback create_delegate_callback_;
- base::Closure deleter_callback_;
+ DeleterCallback deleter_callback_;
base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(MojoAudioOutputStreamProvider);
« no previous file with comments | « media/audio/audio_system_impl.cc ('k') | media/mojo/services/mojo_audio_output_stream_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698