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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 bool success, | 76 bool success, |
77 const media::AudioParameters& output_params) { | 77 const media::AudioParameters& output_params) { |
78 NOTREACHED(); | 78 NOTREACHED(); |
79 } | 79 } |
80 | 80 |
81 void PepperPlatformAudioOutput::OnStreamCreated( | 81 void PepperPlatformAudioOutput::OnStreamCreated( |
82 base::SharedMemoryHandle handle, | 82 base::SharedMemoryHandle handle, |
83 base::SyncSocket::Handle socket_handle, | 83 base::SyncSocket::Handle socket_handle, |
84 int length) { | 84 int length) { |
85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
86 DCHECK(handle); | 86 DCHECK(handle.IsValid()); |
87 DCHECK(socket_handle); | 87 DCHECK(socket_handle); |
88 #else | 88 #else |
89 DCHECK(base::SharedMemory::IsHandleValid(handle)); | 89 DCHECK(base::SharedMemory::IsHandleValid(handle)); |
90 DCHECK_NE(-1, socket_handle); | 90 DCHECK_NE(-1, socket_handle); |
91 #endif | 91 #endif |
92 DCHECK(length); | 92 DCHECK(length); |
93 | 93 |
94 if (base::ThreadTaskRunnerHandle::Get().get() == main_task_runner_.get()) { | 94 if (base::ThreadTaskRunnerHandle::Get().get() == main_task_runner_.get()) { |
95 // Must dereference the client only on the main thread. Shutdown may have | 95 // Must dereference the client only on the main thread. Shutdown may have |
96 // occurred while the request was in-flight, so we need to NULL check. | 96 // occurred while the request was in-flight, so we need to NULL check. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return; | 172 return; |
173 | 173 |
174 ipc_->CloseStream(); | 174 ipc_->CloseStream(); |
175 ipc_.reset(); | 175 ipc_.reset(); |
176 | 176 |
177 Release(); // Release for the delegate, balances out the reference taken in | 177 Release(); // Release for the delegate, balances out the reference taken in |
178 // PepperPlatformAudioOutput::Create. | 178 // PepperPlatformAudioOutput::Create. |
179 } | 179 } |
180 | 180 |
181 } // namespace content | 181 } // namespace content |
OLD | NEW |