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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 void PepperPlatformAudioOutput::OnStateChanged( | 72 void PepperPlatformAudioOutput::OnStateChanged( |
73 media::AudioOutputIPCDelegateState 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.IsValid()); |
81 DCHECK(socket_handle); | 81 DCHECK(socket_handle); |
82 #else | 82 #else |
83 DCHECK(base::SharedMemory::IsHandleValid(handle)); | 83 DCHECK(base::SharedMemory::IsHandleValid(handle)); |
84 DCHECK_NE(-1, socket_handle); | 84 DCHECK_NE(-1, socket_handle); |
85 #endif | 85 #endif |
86 DCHECK(length); | 86 DCHECK(length); |
87 | 87 |
88 if (base::ThreadTaskRunnerHandle::Get().get() == main_task_runner_.get()) { | 88 if (base::ThreadTaskRunnerHandle::Get().get() == main_task_runner_.get()) { |
89 // Must dereference the client only on the main thread. Shutdown may have | 89 // Must dereference the client only on the main thread. Shutdown may have |
90 // occurred while the request was in-flight, so we need to NULL check. | 90 // occurred while the request was in-flight, so we need to NULL check. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return; | 168 return; |
169 | 169 |
170 ipc_->CloseStream(); | 170 ipc_->CloseStream(); |
171 ipc_.reset(); | 171 ipc_.reset(); |
172 | 172 |
173 Release(); // Release for the delegate, balances out the reference taken in | 173 Release(); // Release for the delegate, balances out the reference taken in |
174 // PepperPlatformAudioOutput::Create. | 174 // PepperPlatformAudioOutput::Create. |
175 } | 175 } |
176 | 176 |
177 } // namespace content | 177 } // namespace content |
OLD | NEW |