| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
| 6 #include <stddef.h> | 6 #include <stddef.h> |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 PpapiPluginMsg_VideoDecoder_GetShmReply shm_msg_reply(kShmSize); | 145 PpapiPluginMsg_VideoDecoder_GetShmReply shm_msg_reply(kShmSize); |
| 146 ResourceSyncCallHandler shm_msg_handler( | 146 ResourceSyncCallHandler shm_msg_handler( |
| 147 &sink(), PpapiHostMsg_VideoDecoder_GetShm::ID, PP_OK, shm_msg_reply); | 147 &sink(), PpapiHostMsg_VideoDecoder_GetShm::ID, PP_OK, shm_msg_reply); |
| 148 sink().AddFilter(&shm_msg_handler); | 148 sink().AddFilter(&shm_msg_handler); |
| 149 | 149 |
| 150 std::unique_ptr<base::SharedMemoryHandle> shm_handle; | 150 std::unique_ptr<base::SharedMemoryHandle> shm_handle; |
| 151 std::unique_ptr<SerializedHandle> serialized_handle; | 151 std::unique_ptr<SerializedHandle> serialized_handle; |
| 152 base::SharedMemory shm; | 152 base::SharedMemory shm; |
| 153 if (expected_shm_msg) { | 153 if (expected_shm_msg) { |
| 154 shm.CreateAnonymous(kShmSize); | 154 shm.CreateAnonymous(kShmSize); |
| 155 shm_handle.reset(new base::SharedMemoryHandle()); | 155 shm_handle.reset(new base::SharedMemoryHandle(shm.handle().Duplicate())); |
| 156 shm.ShareToProcess(base::GetCurrentProcessHandle(), shm_handle.get()); | |
| 157 serialized_handle.reset(new SerializedHandle(*shm_handle, kShmSize)); | 156 serialized_handle.reset(new SerializedHandle(*shm_handle, kShmSize)); |
| 158 shm_msg_handler.set_serialized_handle(serialized_handle.get()); | 157 shm_msg_handler.set_serialized_handle(serialized_handle.get()); |
| 159 } | 158 } |
| 160 | 159 |
| 161 memset(decode_buffer_, 0x55, kDecodeBufferSize); | 160 memset(decode_buffer_, 0x55, kDecodeBufferSize); |
| 162 int32_t result = | 161 int32_t result = |
| 163 decoder_iface()->Decode(pp_decoder, | 162 decoder_iface()->Decode(pp_decoder, |
| 164 kDecodeId, | 163 kDecodeId, |
| 165 kDecodeBufferSize, | 164 kDecodeBufferSize, |
| 166 decode_buffer_, | 165 decode_buffer_, |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 ASSERT_FALSE(uncalled_cb.called()); | 583 ASSERT_FALSE(uncalled_cb.called()); |
| 585 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallFlush(decoder.get(), &uncalled_cb)); | 584 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallFlush(decoder.get(), &uncalled_cb)); |
| 586 ASSERT_FALSE(uncalled_cb.called()); | 585 ASSERT_FALSE(uncalled_cb.called()); |
| 587 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallReset(decoder.get(), &uncalled_cb)); | 586 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallReset(decoder.get(), &uncalled_cb)); |
| 588 ASSERT_FALSE(uncalled_cb.called()); | 587 ASSERT_FALSE(uncalled_cb.called()); |
| 589 } | 588 } |
| 590 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS) | 589 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS) |
| 591 | 590 |
| 592 } // namespace proxy | 591 } // namespace proxy |
| 593 } // namespace ppapi | 592 } // namespace ppapi |
| OLD | NEW |