OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/common/gpu/client/gpu_jpeg_decode_accelerator_host.h" | 5 #include "content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 channel_->ShareToGpuProcess(bitstream_buffer.handle()); | 157 channel_->ShareToGpuProcess(bitstream_buffer.handle()); |
158 if (!base::SharedMemory::IsHandleValid(input_handle)) { | 158 if (!base::SharedMemory::IsHandleValid(input_handle)) { |
159 DLOG(ERROR) << "Failed to duplicate handle of BitstreamBuffer"; | 159 DLOG(ERROR) << "Failed to duplicate handle of BitstreamBuffer"; |
160 return; | 160 return; |
161 } | 161 } |
162 decode_params.input_buffer.set_handle(input_handle); | 162 decode_params.input_buffer.set_handle(input_handle); |
163 base::SharedMemoryHandle output_handle = | 163 base::SharedMemoryHandle output_handle = |
164 channel_->ShareToGpuProcess(video_frame->shared_memory_handle()); | 164 channel_->ShareToGpuProcess(video_frame->shared_memory_handle()); |
165 if (!base::SharedMemory::IsHandleValid(output_handle)) { | 165 if (!base::SharedMemory::IsHandleValid(output_handle)) { |
166 DLOG(ERROR) << "Failed to duplicate handle of VideoFrame"; | 166 DLOG(ERROR) << "Failed to duplicate handle of VideoFrame"; |
167 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS)) | 167 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
168 if (input_handle.auto_close) { | 168 if (input_handle.auto_close) { |
169 // Defer closing task to the ScopedFD. | 169 // Defer closing task to the ScopedFD. |
170 base::ScopedFD(input_handle.fd); | 170 base::ScopedFD(input_handle.fd); |
171 } | 171 } |
172 #else | 172 #else |
173 // TODO(kcwu) fix the handle leak after crbug.com/493414 resolved. | 173 // TODO(kcwu) fix the handle leak after crbug.com/493414 resolved. |
174 #endif | 174 #endif |
175 return; | 175 return; |
176 } | 176 } |
177 | 177 |
(...skipping 17 matching lines...) Expand all Loading... |
195 if (!channel_->Send(message)) { | 195 if (!channel_->Send(message)) { |
196 DLOG(ERROR) << "Send(" << message->type() << ") failed"; | 196 DLOG(ERROR) << "Send(" << message->type() << ") failed"; |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 base::WeakPtr<IPC::Listener> GpuJpegDecodeAcceleratorHost::GetReceiver() { | 200 base::WeakPtr<IPC::Listener> GpuJpegDecodeAcceleratorHost::GetReceiver() { |
201 return receiver_->AsWeakPtrForIO(); | 201 return receiver_->AsWeakPtrForIO(); |
202 } | 202 } |
203 | 203 |
204 } // namespace content | 204 } // namespace content |
OLD | NEW |