| 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.h" | 5 #include "content/renderer/pepper/pepper_platform_audio_output.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void PepperPlatformAudioOutput::ShutDown() { | 63 void PepperPlatformAudioOutput::ShutDown() { |
| 64 // Called on the main thread to stop all audio callbacks. We must only change | 64 // Called on the main thread to stop all audio callbacks. We must only change |
| 65 // the client on the main thread, and the delegates from the I/O thread. | 65 // the client on the main thread, and the delegates from the I/O thread. |
| 66 client_ = NULL; | 66 client_ = NULL; |
| 67 io_task_runner_->PostTask( | 67 io_task_runner_->PostTask( |
| 68 FROM_HERE, | 68 FROM_HERE, |
| 69 base::Bind(&PepperPlatformAudioOutput::ShutDownOnIOThread, this)); | 69 base::Bind(&PepperPlatformAudioOutput::ShutDownOnIOThread, this)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void PepperPlatformAudioOutput::OnStateChanged( | 72 void PepperPlatformAudioOutput::OnStateChanged( |
| 73 media::AudioOutputIPCDelegate::State state) {} | 73 media::AudioOutputIPCDelegateState state) {} |
| 74 | 74 |
| 75 void PepperPlatformAudioOutput::OnStreamCreated( | 75 void PepperPlatformAudioOutput::OnStreamCreated( |
| 76 base::SharedMemoryHandle handle, | 76 base::SharedMemoryHandle handle, |
| 77 base::SyncSocket::Handle socket_handle, | 77 base::SyncSocket::Handle socket_handle, |
| 78 int length) { | 78 int length) { |
| 79 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
| 80 DCHECK(handle); | 80 DCHECK(handle); |
| 81 DCHECK(socket_handle); | 81 DCHECK(socket_handle); |
| 82 #else | 82 #else |
| 83 DCHECK(base::SharedMemory::IsHandleValid(handle)); | 83 DCHECK(base::SharedMemory::IsHandleValid(handle)); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return; | 164 return; |
| 165 | 165 |
| 166 ipc_->CloseStream(); | 166 ipc_->CloseStream(); |
| 167 ipc_.reset(); | 167 ipc_.reset(); |
| 168 | 168 |
| 169 Release(); // Release for the delegate, balances out the reference taken in | 169 Release(); // Release for the delegate, balances out the reference taken in |
| 170 // PepperPlatformAudioOutput::Create. | 170 // PepperPlatformAudioOutput::Create. |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace content | 173 } // namespace content |
| OLD | NEW |