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 "content/renderer/pepper/pepper_platform_audio_output_impl.h" | 5 #include "content/renderer/pepper/pepper_platform_audio_output_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "content/common/child_process.h" | 11 #include "content/common/child_process.h" |
12 #include "content/common/media/audio_messages.h" | 12 #include "content/common/media/audio_messages.h" |
13 #include "content/renderer/media/audio_hardware.h" | 13 #include "content/renderer/media/audio_hardware.h" |
14 #include "content/renderer/render_thread_impl.h" | 14 #include "content/renderer/render_thread_impl.h" |
15 | 15 |
| 16 namespace content { |
| 17 |
16 PepperPlatformAudioOutputImpl::PepperPlatformAudioOutputImpl() | 18 PepperPlatformAudioOutputImpl::PepperPlatformAudioOutputImpl() |
17 : client_(NULL), | 19 : client_(NULL), |
18 stream_id_(0), | 20 stream_id_(0), |
19 main_message_loop_proxy_(base::MessageLoopProxy::current()) { | 21 main_message_loop_proxy_(base::MessageLoopProxy::current()) { |
20 filter_ = RenderThreadImpl::current()->audio_message_filter(); | 22 filter_ = RenderThreadImpl::current()->audio_message_filter(); |
21 } | 23 } |
22 | 24 |
23 PepperPlatformAudioOutputImpl::~PepperPlatformAudioOutputImpl() { | 25 PepperPlatformAudioOutputImpl::~PepperPlatformAudioOutputImpl() { |
24 // Make sure we have been shut down. Warning: this will usually happen on | 26 // Make sure we have been shut down. Warning: this will usually happen on |
25 // the I/O thread! | 27 // the I/O thread! |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Must dereference the client only on the main thread. Shutdown may have | 156 // Must dereference the client only on the main thread. Shutdown may have |
155 // occurred while the request was in-flight, so we need to NULL check. | 157 // occurred while the request was in-flight, so we need to NULL check. |
156 if (client_) | 158 if (client_) |
157 client_->StreamCreated(handle, length, socket_handle); | 159 client_->StreamCreated(handle, length, socket_handle); |
158 } else { | 160 } else { |
159 main_message_loop_proxy_->PostTask(FROM_HERE, | 161 main_message_loop_proxy_->PostTask(FROM_HERE, |
160 base::Bind(&PepperPlatformAudioOutputImpl::OnStreamCreated, this, | 162 base::Bind(&PepperPlatformAudioOutputImpl::OnStreamCreated, this, |
161 handle, socket_handle, length)); | 163 handle, socket_handle, length)); |
162 } | 164 } |
163 } | 165 } |
| 166 |
| 167 } // namespace content |
OLD | NEW |