audio_output_dispatcher.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "media/audio/audio_output_dispatcher.h"
6
7#include "base/message_loop.h"
8
9namespace media {
10
11AudioOutputDispatcher::AudioOutputDispatcher(
12    AudioManager* audio_manager,
13    const AudioParameters& params)
14    : audio_manager_(audio_manager),
15      message_loop_(MessageLoop::current()),
16      params_(params) {
17  // We expect to be instantiated on the audio thread.  Otherwise the
18  // message_loop_ member will point to the wrong message loop!
19  DCHECK(audio_manager->GetMessageLoop()->BelongsToCurrentThread());
20}
21
22AudioOutputDispatcher::~AudioOutputDispatcher() {
23  DCHECK_EQ(MessageLoop::current(), message_loop_);
24}
25
26}  // namespace media
27