Index: media/audio/audio_manager.cc |
diff --git a/media/audio/audio_manager.cc b/media/audio/audio_manager.cc |
index 4b98e36910f500ecd31402fcf2a7ffec1a277a74..e0c9fbd967cdf572e48501947fbc7b23dda23f35 100644 |
--- a/media/audio/audio_manager.cc |
+++ b/media/audio/audio_manager.cc |
@@ -254,21 +254,20 @@ void AudioManagerDeleter::operator()(const AudioManager* instance) const { |
LOG(WARNING) << "Multiple instances of AudioManager detected"; |
} |
-#if defined(OS_MACOSX) |
// If we are on Mac, tasks after this point are not executed, hence this is |
Guido Urdaneta
2017/04/06 14:26:41
The code is no longer Mac specific. Update the com
DaleCurtis
2017/04/06 18:37:17
Comment needs to change. Did you mean to leave thi
o1ka
2017/04/07 12:22:17
Done.
o1ka
2017/04/07 12:22:17
Done.
|
// the only chance to delete the audio manager (which on Mac lives on the |
// main browser thread instead of a dedicated audio thread). If we don't |
// delete here, the CoreAudio thread can keep providing callbacks, which |
// uses a state that is destroyed in ~BrowserMainLoop(). |
// See http://crbug.com/623703 for more details. |
- DCHECK(instance->GetTaskRunner()->BelongsToCurrentThread()); |
- delete instance; |
-#else |
+ if (instance->GetTaskRunner()->BelongsToCurrentThread()) { |
+ delete instance; |
+ return; |
+ } |
+ |
// AudioManager must be destroyed on the audio thread. |
- if (!instance->GetTaskRunner()->DeleteSoon(FROM_HERE, instance)) { |
+ if (!instance->GetTaskRunner()->DeleteSoon(FROM_HERE, instance)) |
LOG(WARNING) << "Failed to delete AudioManager instance."; |
- } |
-#endif |
} |
// Forward declaration of the platform specific AudioManager factory function. |