New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 705455 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome
Pri: 2
Type: Bug



Sign in to add a comment

AudioManager needs to make sure no operations on it can be executed on audio thread after AudioManager destructor

Project Member Reported by olka@chromium.org, Mar 27 2017

Issue description

It's considered safe to post AudioManager* as Unretained() to the audio thread, because it's
destroyed on audio thread during browser main loop destruction.
But if a task posted to audio thread before AM destructor posts AM
operation to audio thread, then we have AM operation scheduled after AM
destruction.
We need to make sure no operations on it can be executed on audio thread after AudioManager destructor.

Same is applicable to AudioSystem.
 

Comment 1 by alokp@chromium.org, Mar 28 2017

Status: Started (was: Assigned)

Comment 2 by olka@chromium.org, Apr 7 2017

Description: Show this description
Project Member

Comment 3 by bugdroid1@chromium.org, May 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2cbd4fcab300af5aa4ef76752673901d58da0f24

commit 2cbd4fcab300af5aa4ef76752673901d58da0f24
Author: alokp <alokp@chromium.org>
Date: Sat May 13 04:13:24 2017

Ensures that audio tasks cannot run after AudioManager is deleted.

AudioManager is now deleted on the main thread instead of the audio
thread. It is Shutdown on the audio thread which allows it to release
resources on the correct thread. Audio thread is then stopped before
audio manager is deleted so that all tasks in the audio thread queue
runs and no more tasks can be posted.

BUG= 705455 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2784433002
Cr-Commit-Position: refs/heads/master@{#471558}

[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/chromecast/browser/cast_content_browser_client.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/chromecast/browser/cast_content_browser_client.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/chromecast/media/BUILD.gn
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/chromecast/media/audio/cast_audio_manager.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/chromecast/media/audio/cast_audio_manager.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/chromecast/media/audio/cast_audio_mixer_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/chromecast/media/audio/cast_audio_output_stream_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/BUILD.gn
[delete] https://crrev.com/ff06c2bf52f825866cb1c1c928bc6510da49ad9c/content/browser/audio_manager_thread.cc
[delete] https://crrev.com/ff06c2bf52f825866cb1c1c928bc6510da49ad9c/content/browser/audio_manager_thread.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/browser_main_loop.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/browser_main_loop.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/audio_input_renderer_host_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/audio_output_authorization_handler_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/audio_output_delegate_impl_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/audio_renderer_host_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/media_devices_manager_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/media_stream_manager_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/renderer_audio_output_stream_factory_context_impl_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/renderer_host/media/video_capture_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/speech/speech_recognition_browsertest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/browser/speech/speech_recognizer_impl_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/public/browser/content_browser_client.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/content/public/browser/content_browser_client.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/BUILD.gn
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/alsa/alsa_output_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/alsa/audio_manager_alsa.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/alsa/audio_manager_alsa.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/android/audio_android_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/android/audio_manager_android.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/android/audio_manager_android.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_input_controller_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_input_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_low_latency_input_output_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_manager.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_manager.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_manager_base.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_manager_base.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_manager_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_output_controller_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_output_proxy_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_system_impl_unittest.cc
[add] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_thread.h
[add] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_thread_impl.cc
[add] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/audio_thread_impl.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/cras/audio_manager_cras.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/cras/audio_manager_cras.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/cras/cras_input_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/cras/cras_unified_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/fake_audio_manager.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/fake_audio_manager.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/linux/audio_manager_linux.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/mac/audio_auhal_mac_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/mac/audio_low_latency_input_mac_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/mac/audio_manager_mac.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/mac/audio_manager_mac.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/mock_audio_manager.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/mock_audio_manager.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/pulse/audio_manager_pulse.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/pulse/audio_manager_pulse.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/pulse/pulse_util.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/pulse/pulse_util.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/sounds/audio_stream_handler_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/sounds/sounds_manager_unittest.cc
[add] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/test_audio_thread.cc
[add] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/test_audio_thread.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/win/audio_low_latency_input_win_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/win/audio_low_latency_output_win_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/win/audio_manager_win.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/win/audio_manager_win.h
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/audio/win/audio_output_win_unittest.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/cast/BUILD.gn
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/cast/test/receiver.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/mojo/services/test_mojo_media_client.cc
[modify] https://crrev.com/2cbd4fcab300af5aa4ef76752673901d58da0f24/media/mojo/services/test_mojo_media_client.h

Comment 4 by alokp@chromium.org, Jun 5 2017

Status: Fixed (was: Started)

Sign in to add a comment