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

Issue 9255017: Add thread safety to AudioManagerBase to protect access to the audio thread member variable. (Closed)

Created:
8 years, 11 months ago by tommi (sloooow) - chröme
Modified:
8 years, 11 months ago
Reviewers:
enal
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, acolwell+watch_chromium.org, annacc+watch_chromium.org, vrk (LEFT CHROMIUM), scherkus (not reviewing), ihf+watch_chromium.org
Visibility:
Public.

Description

Add thread safety to AudioManagerBase to protect access to the audio thread member variable. This is is a tentative fix for an issue where the AudioManager can crash while tearing down the audio thread. I suspect that this happens because more than one cleanup attempts were made since the class wasn't thread safe. I'm also changing direct access to the thread's MessageLoop* to use MessageLoopProxy based on the same theory. BUG=110051 TEST=Run media tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=118272

Patch Set 1 #

Total comments: 2

Patch Set 2 : added webrtc_audio_device_test files #

Patch Set 3 : Removed CurrentThreadIsAudioThread and switched to inheriting from NonThreadSafe #

Patch Set 4 : Fix linux issues. #

Total comments: 1

Patch Set 5 : Fix style issue #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -95 lines) Patch
M content/test/webrtc_audio_device_test.h View 1 1 chunk +1 line, -1 line 0 comments Download
M content/test/webrtc_audio_device_test.cc View 1 2 chunks +4 lines, -2 lines 0 comments Download
M media/audio/audio_low_latency_input_output_unittest.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M media/audio/audio_manager.h View 2 chunks +4 lines, -1 line 0 comments Download
M media/audio/audio_manager_base.h View 3 chunks +11 lines, -5 lines 0 comments Download
M media/audio/audio_manager_base.cc View 4 chunks +41 lines, -20 lines 0 comments Download
M media/audio/audio_output_controller.h View 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_output_controller.cc View 11 chunks +15 lines, -14 lines 0 comments Download
M media/audio/audio_output_dispatcher.h View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M media/audio/audio_output_dispatcher.cc View 1 2 3 chunks +4 lines, -6 lines 0 comments Download
M media/audio/audio_output_proxy.h View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M media/audio/audio_output_proxy.cc View 1 2 5 chunks +7 lines, -8 lines 0 comments Download
M media/audio/audio_output_proxy_unittest.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M media/audio/linux/alsa_output.cc View 1 2 3 13 chunks +15 lines, -15 lines 0 comments Download
M media/audio/linux/alsa_output_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M media/audio/linux/audio_manager_linux.cc View 1 2 3 2 chunks +2 lines, -13 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
tommi (sloooow) - chröme
8 years, 11 months ago (2012-01-18 16:16:42 UTC) #1
enal1
LGTM. I hope you fix the trybot failures.
8 years, 11 months ago (2012-01-18 18:03:17 UTC) #2
scherkus (not reviewing)
drive by https://chromiumcodereview.appspot.com/9255017/diff/1/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc (right): https://chromiumcodereview.appspot.com/9255017/diff/1/media/audio/audio_manager_base.cc#newcode110 media/audio/audio_manager_base.cc:110: return; indent https://chromiumcodereview.appspot.com/9255017/diff/1/media/audio/audio_output_dispatcher.cc File media/audio/audio_output_dispatcher.cc (right): https://chromiumcodereview.appspot.com/9255017/diff/1/media/audio/audio_output_dispatcher.cc#newcode138 ...
8 years, 11 months ago (2012-01-18 18:12:31 UTC) #3
tommi (sloooow) - chröme
Thanks Andrew. That's a good suggestion. I'll make the change and ping back once everything ...
8 years, 11 months ago (2012-01-18 19:59:39 UTC) #4
tommi (sloooow) - chröme
Thanks Eugene - yes... failed to include files from content :-/ sorry about that. Will ...
8 years, 11 months ago (2012-01-18 20:00:32 UTC) #5
tommi (sloooow) - chröme
ok, all done.
8 years, 11 months ago (2012-01-18 23:09:07 UTC) #6
scherkus (not reviewing)
8 years, 11 months ago (2012-01-19 01:39:59 UTC) #7
thanks!!

LGTM w/ one nit

https://chromiumcodereview.appspot.com/9255017/diff/3003/media/audio/audio_ou...
File media/audio/audio_output_proxy.h (right):

https://chromiumcodereview.appspot.com/9255017/diff/3003/media/audio/audio_ou...
media/audio/audio_output_proxy.h:25: class MEDIA_EXPORT AudioOutputProxy :
nit: initializer list format

class Foo
    : public Bar,
      public Baz, {
  // ....
};

Powered by Google App Engine
This is Rietveld 408576698