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

Unified Diff: media/audio/audio_system.cc

Issue 2763383002: Switching AudioInputDeviceManager from using AudioManager interface to AudioSystem one. (Closed)
Patch Set: 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/audio_system.cc
diff --git a/media/audio/audio_system.cc b/media/audio/audio_system.cc
index 953be40caa007d0ede558a8faef95d2e2babc6ab..1d082ae5686b99c677a5871845ab02ccc35f16a5 100644
--- a/media/audio/audio_system.cc
+++ b/media/audio/audio_system.cc
@@ -3,11 +3,26 @@
// found in the LICENSE file.
#include "media/audio/audio_system.h"
+#include "base/single_thread_task_runner.h"
namespace media {
static AudioSystem* g_last_created = nullptr;
+void AudioSystem::OnAudioThreadDeleter::operator()(
+ const AudioSystem* instance) const {
+ CHECK(instance);
+ AudioSystem::ClearInstance(instance);
+
+ if (instance->GetTaskRunner()->BelongsToCurrentThread()) {
+ delete instance;
+ return;
+ }
+ if (!instance->GetTaskRunner()->DeleteSoon(FROM_HERE, instance)) {
+ LOG(WARNING) << "Failed to delete AudioManager instance.";
+ }
+}
+
AudioSystem::~AudioSystem() {}
AudioSystem* AudioSystem::Get() {

Powered by Google App Engine
This is Rietveld 408576698