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

Unified Diff: chrome/browser/chromeos/audio_mixer_alsa.cc

Issue 6374010: Add MessageLoop::AssertIdle(). Use in ChromeOS audio threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments. Created 9 years, 11 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
« no previous file with comments | « base/message_loop.cc ('k') | chrome/browser/chromeos/audio_mixer_pulse.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/audio_mixer_alsa.cc
diff --git a/chrome/browser/chromeos/audio_mixer_alsa.cc b/chrome/browser/chromeos/audio_mixer_alsa.cc
index a42868e339dc89ff877dfc6a3bd42ecbc60b4152..bb1c1df960c8c190459671f7a62c3c62dacf80e3 100644
--- a/chrome/browser/chromeos/audio_mixer_alsa.cc
+++ b/chrome/browser/chromeos/audio_mixer_alsa.cc
@@ -7,6 +7,7 @@
#include <alsa/asoundlib.h>
#include "base/logging.h"
+#include "base/message_loop.h"
#include "base/task.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
@@ -28,8 +29,8 @@ typedef long alsa_long_t; // 'long' is required for ALSA API calls.
namespace {
-const char* kMasterVolume = "Master";
-const char* kPCMVolume = "PCM";
+const char kMasterVolume[] = "Master";
+const char kPCMVolume[] = "PCM";
const double kDefaultMinVolume = -90.0;
const double kDefaultMaxVolume = 0.0;
const double kPrefVolumeInvalid = -999.0;
@@ -56,6 +57,7 @@ AudioMixerAlsa::~AudioMixerAlsa() {
// The worker thread should be idle at this time.
// See http://crosbug.com/11110 for discussion.
base::ThreadRestrictions::ScopedAllowIO allow_io_for_thread_join;
+ thread_->message_loop()->AssertIdle();
thread_->Stop();
thread_.reset();
@@ -444,4 +446,3 @@ void AudioMixerAlsa::SetElementMuted_Locked(snd_mixer_elem_t* elem, bool mute) {
}
} // namespace chromeos
-
« no previous file with comments | « base/message_loop.cc ('k') | chrome/browser/chromeos/audio_mixer_pulse.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698