Chromium Code Reviews| Index: content/common/gpu/media/android_video_decode_accelerator.cc | 
| diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc | 
| index 5eb4b9e5941e3c2df26c4524e340af22996132d9..68c7532dad9f10e259d1fa5728fac0ebad8f6b42 100644 | 
| --- a/content/common/gpu/media/android_video_decode_accelerator.cc | 
| +++ b/content/common/gpu/media/android_video_decode_accelerator.cc | 
| @@ -18,6 +18,7 @@ | 
| #include "content/common/gpu/gpu_channel.h" | 
| #include "content/common/gpu/media/android_copying_backing_strategy.h" | 
| #include "content/common/gpu/media/android_deferred_rendering_backing_strategy.h" | 
| +#include "content/common/gpu/media/shared_memory_region.h" | 
| #include "content/public/common/content_switches.h" | 
| #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 
| #include "gpu/command_buffer/service/gpu_switches.h" | 
| @@ -379,17 +380,17 @@ bool AndroidVideoDecodeAccelerator::QueueInput() { | 
| return true; | 
| } | 
| - scoped_ptr<base::SharedMemory> shm; | 
| + scoped_ptr<SharedMemoryRegion> shm; | 
| if (pending_input_buf_index_ != -1) { | 
| // The buffer is already dequeued from MediaCodec, filled with data and | 
| // bitstream_buffer.handle() is closed. | 
| - shm.reset(new base::SharedMemory()); | 
| + shm.reset(new SharedMemoryRegion(base::SharedMemoryHandle(), 0, 0, false)); | 
| 
 
dcheng
2016/03/01 01:48:43
Maybe just shm.reset() and null check when initial
 
Owen Lin
2016/03/02 02:50:53
Thanks.
 
 | 
| } else { | 
| - shm.reset(new base::SharedMemory(bitstream_buffer.handle(), true)); | 
| + shm.reset(new SharedMemoryRegion(bitstream_buffer, true)); | 
| - if (!shm->Map(bitstream_buffer.size())) { | 
| - POST_ERROR(UNREADABLE_INPUT, "Failed to SharedMemory::Map()"); | 
| + if (!shm->Map()) { | 
| + POST_ERROR(UNREADABLE_INPUT, "Failed to SharedMemoryRegion::Map()"); | 
| return false; | 
| } | 
| } |