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

Unified Diff: media/audio/pulse/audio_manager_pulse.cc

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: fixes content_browsertests and content_unittests Created 3 years, 9 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/pulse/audio_manager_pulse.cc
diff --git a/media/audio/pulse/audio_manager_pulse.cc b/media/audio/pulse/audio_manager_pulse.cc
index 779bf92e58d3d39c981f398cf911ed504bc2191f..ff27837e768dd6ff74153e01fe11c7f0e1cc44a2 100644
--- a/media/audio/pulse/audio_manager_pulse.cc
+++ b/media/audio/pulse/audio_manager_pulse.cc
@@ -63,12 +63,7 @@ AudioManagerPulse::AudioManagerPulse(
SetMaxOutputStreamsAllowed(kMaxOutputStreams);
}
-AudioManagerPulse::~AudioManagerPulse() {
- Shutdown();
- // The Pulse objects are the last things to be destroyed since Shutdown()
- // needs them.
- DestroyPulse();
-}
+AudioManagerPulse::~AudioManagerPulse() = default;
bool AudioManagerPulse::Init() {
// TODO(alokp): Investigate if InitPulse can happen on the audio thread.
@@ -79,7 +74,13 @@ bool AudioManagerPulse::Init() {
return InitPulse();
}
-// Implementation of AudioManager.
+void AudioManagerPulse::Shutdown() {
+ AudioManagerBase::Shutdown();
+ // The Pulse objects are the last things to be destroyed since Shutdown()
+ // needs them.
+ DestroyPulse();
+}
+
bool AudioManagerPulse::HasAudioOutputDevices() {
AudioDeviceNames devices;
GetAudioOutputDeviceNames(&devices);

Powered by Google App Engine
This is Rietveld 408576698