OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/audio_output_proxy.h" | 5 #include "media/audio/audio_output_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "media/audio/audio_manager.h" | 9 #include "media/audio/audio_manager.h" |
10 #include "media/audio/audio_output_dispatcher.h" | 10 #include "media/audio/audio_output_dispatcher.h" |
11 | 11 |
12 namespace media { | |
13 | |
14 AudioOutputProxy::AudioOutputProxy(AudioOutputDispatcher* dispatcher) | 12 AudioOutputProxy::AudioOutputProxy(AudioOutputDispatcher* dispatcher) |
15 : dispatcher_(dispatcher), | 13 : dispatcher_(dispatcher), |
16 state_(kCreated), | 14 state_(kCreated), |
17 physical_stream_(NULL), | 15 physical_stream_(NULL), |
18 volume_(1.0) { | 16 volume_(1.0) { |
19 } | 17 } |
20 | 18 |
21 AudioOutputProxy::~AudioOutputProxy() { | 19 AudioOutputProxy::~AudioOutputProxy() { |
22 DCHECK(CalledOnValidThread()); | 20 DCHECK(CalledOnValidThread()); |
23 DCHECK(state_ == kCreated || state_ == kClosed); | 21 DCHECK(state_ == kCreated || state_ == kClosed); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 dispatcher_->StreamClosed(); | 86 dispatcher_->StreamClosed(); |
89 | 87 |
90 state_ = kClosed; | 88 state_ = kClosed; |
91 | 89 |
92 // Delete the object now like is done in the Close() implementation of | 90 // Delete the object now like is done in the Close() implementation of |
93 // physical stream objects. If we delete the object via DeleteSoon, we | 91 // physical stream objects. If we delete the object via DeleteSoon, we |
94 // unnecessarily complicate the Shutdown procedure of the | 92 // unnecessarily complicate the Shutdown procedure of the |
95 // dispatcher+audio manager. | 93 // dispatcher+audio manager. |
96 delete this; | 94 delete this; |
97 } | 95 } |
98 | |
99 } // namespace media | |
OLD | NEW |