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

Unified Diff: media/audio/mac/audio_manager_mac.cc

Issue 66183002: Replace MessageLoopProxy with SingleThreadTaskRunner for the rest of media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win and audio tests Created 6 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 | « media/audio/mac/audio_manager_mac.h ('k') | media/audio/mock_audio_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_manager_mac.cc
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index be7dddd5bb68c23c830f0fd3592cd75ce274ae32..1dca1c371f6449aa35712ec6b98441706610aa2f 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -230,17 +230,17 @@ AudioManagerMac::AudioManagerMac(AudioLogFactory* audio_log_factory)
// Task must be posted last to avoid races from handing out "this" to the
// audio thread. Always PostTask even if we're on the right thread since
// AudioManager creation is on the startup path and this may be slow.
- GetMessageLoop()->PostTask(FROM_HERE, base::Bind(
+ GetTaskRunner()->PostTask(FROM_HERE, base::Bind(
&AudioManagerMac::CreateDeviceListener, base::Unretained(this)));
}
AudioManagerMac::~AudioManagerMac() {
- if (GetMessageLoop()->BelongsToCurrentThread()) {
+ if (GetTaskRunner()->BelongsToCurrentThread()) {
DestroyDeviceListener();
} else {
// It's safe to post a task here since Shutdown() will wait for all tasks to
// complete before returning.
- GetMessageLoop()->PostTask(FROM_HERE, base::Bind(
+ GetTaskRunner()->PostTask(FROM_HERE, base::Bind(
&AudioManagerMac::DestroyDeviceListener, base::Unretained(this)));
}
@@ -693,7 +693,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
}
void AudioManagerMac::CreateDeviceListener() {
- DCHECK(GetMessageLoop()->BelongsToCurrentThread());
+ DCHECK(GetTaskRunner()->BelongsToCurrentThread());
// Get a baseline for the sample-rate and current device,
// so we can intelligently handle device notifications only when necessary.
@@ -706,13 +706,13 @@ void AudioManagerMac::CreateDeviceListener() {
}
void AudioManagerMac::DestroyDeviceListener() {
- DCHECK(GetMessageLoop()->BelongsToCurrentThread());
+ DCHECK(GetTaskRunner()->BelongsToCurrentThread());
output_device_listener_.reset();
}
void AudioManagerMac::HandleDeviceChanges() {
- if (!GetMessageLoop()->BelongsToCurrentThread()) {
- GetMessageLoop()->PostTask(FROM_HERE, base::Bind(
+ if (!GetTaskRunner()->BelongsToCurrentThread()) {
+ GetTaskRunner()->PostTask(FROM_HERE, base::Bind(
&AudioManagerMac::HandleDeviceChanges, base::Unretained(this)));
return;
}
« no previous file with comments | « media/audio/mac/audio_manager_mac.h ('k') | media/audio/mock_audio_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698