Index: media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc |
diff --git a/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc b/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc |
index 70ab13063be8f6cba2609679ff7ee820c7a1b49b..68ae0319d75dc4cc605dabc27365dd48123ee44f 100644 |
--- a/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc |
+++ b/media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc |
@@ -24,8 +24,7 @@ namespace media { |
// Class to receive AcceleratedJpegDecoderHostMsg_DecodeAck IPC message on IO |
// thread. This does very similar what MessageFilter usually does. It is not |
// MessageFilter because GpuChannelHost doesn't support AddFilter. |
-class GpuJpegDecodeAcceleratorHost::Receiver : public IPC::Listener, |
- public base::NonThreadSafe { |
+class GpuJpegDecodeAcceleratorHost::Receiver : public IPC::Listener { |
public: |
Receiver(Client* client, |
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) |
@@ -34,11 +33,11 @@ class GpuJpegDecodeAcceleratorHost::Receiver : public IPC::Listener, |
weak_factory_for_io_( |
base::MakeUnique<base::WeakPtrFactory<Receiver>>(this)), |
weak_ptr_for_io_(weak_factory_for_io_->GetWeakPtr()) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
} |
~Receiver() override { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
// If |io_task_runner_| no longer accepts tasks, |weak_factory_for_io_| |
// will leak. This is acceptable, because that should only happen on |
// Browser shutdown. |
@@ -100,6 +99,7 @@ class GpuJpegDecodeAcceleratorHost::Receiver : public IPC::Listener, |
std::unique_ptr<base::WeakPtrFactory<Receiver>> weak_factory_for_io_; |
base::WeakPtr<Receiver> weak_ptr_for_io_; |
+ THREAD_CHECKER(thread_checker_); |
DISALLOW_COPY_AND_ASSIGN(Receiver); |
}; |
@@ -115,7 +115,7 @@ GpuJpegDecodeAcceleratorHost::GpuJpegDecodeAcceleratorHost( |
} |
GpuJpegDecodeAcceleratorHost::~GpuJpegDecodeAcceleratorHost() { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
Send(new AcceleratedJpegDecoderMsg_Destroy(decoder_route_id_)); |
if (receiver_) { |
@@ -140,7 +140,7 @@ GpuJpegDecodeAcceleratorHost::~GpuJpegDecodeAcceleratorHost() { |
bool GpuJpegDecodeAcceleratorHost::Initialize( |
JpegDecodeAccelerator::Client* client) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
bool succeeded = false; |
// This cannot be on IO thread because the msg is synchronous. |
@@ -159,7 +159,7 @@ bool GpuJpegDecodeAcceleratorHost::Initialize( |
void GpuJpegDecodeAcceleratorHost::Decode( |
const BitstreamBuffer& bitstream_buffer, |
const scoped_refptr<VideoFrame>& video_frame) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
DCHECK( |
base::SharedMemory::IsHandleValid(video_frame->shared_memory_handle())); |
@@ -202,7 +202,7 @@ bool GpuJpegDecodeAcceleratorHost::IsSupported() { |
} |
void GpuJpegDecodeAcceleratorHost::Send(IPC::Message* message) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
if (!channel_->Send(message)) { |
DLOG(ERROR) << "Send(" << message->type() << ") failed"; |
@@ -213,4 +213,7 @@ base::WeakPtr<IPC::Listener> GpuJpegDecodeAcceleratorHost::GetReceiver() { |
return receiver_->AsWeakPtrForIO(); |
} |
+void GpuJpegDecodeAcceleratorHost::OnDecodeAck(int32_t bitstream_buffer_id, |
+ mojom::Error error) {} |
+ |
} // namespace media |