Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: ppapi/proxy/video_decoder_resource.cc

Issue 2849633002: Get rid of base::SharedMemory::NULLHandle(); (Closed)
Patch Set: Rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/serialized_handle.cc ('k') | ui/gfx/gpu_memory_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ppapi/proxy/video_decoder_resource.h" 5 #include "ppapi/proxy/video_decoder_resource.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "gpu/command_buffer/client/gles2_cmd_helper.h" 10 #include "gpu/command_buffer/client/gles2_cmd_helper.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 int32_t result = 220 int32_t result =
221 GenericSyncCall(RENDERER, 221 GenericSyncCall(RENDERER,
222 PpapiHostMsg_VideoDecoder_GetShm(shm_id, size), 222 PpapiHostMsg_VideoDecoder_GetShm(shm_id, size),
223 &reply, 223 &reply,
224 &reply_params); 224 &reply_params);
225 if (result != PP_OK) 225 if (result != PP_OK)
226 return PP_ERROR_FAILED; 226 return PP_ERROR_FAILED;
227 if (!UnpackMessage<PpapiPluginMsg_VideoDecoder_GetShmReply>(reply, 227 if (!UnpackMessage<PpapiPluginMsg_VideoDecoder_GetShmReply>(reply,
228 &shm_size)) 228 &shm_size))
229 return PP_ERROR_FAILED; 229 return PP_ERROR_FAILED;
230 base::SharedMemoryHandle shm_handle = base::SharedMemory::NULLHandle(); 230 base::SharedMemoryHandle shm_handle;
231 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &shm_handle)) 231 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &shm_handle))
232 return PP_ERROR_NOMEMORY; 232 return PP_ERROR_NOMEMORY;
233 std::unique_ptr<base::SharedMemory> shm( 233 std::unique_ptr<base::SharedMemory> shm(
234 new base::SharedMemory(shm_handle, false /* read_only */)); 234 new base::SharedMemory(shm_handle, false /* read_only */));
235 std::unique_ptr<ShmBuffer> shm_buffer( 235 std::unique_ptr<ShmBuffer> shm_buffer(
236 new ShmBuffer(std::move(shm), shm_size, shm_id)); 236 new ShmBuffer(std::move(shm), shm_size, shm_id));
237 if (!shm_buffer->addr) 237 if (!shm_buffer->addr)
238 return PP_ERROR_NOMEMORY; 238 return PP_ERROR_NOMEMORY;
239 239
240 available_shm_buffers_.push_back(shm_buffer.get()); 240 available_shm_buffers_.push_back(shm_buffer.get());
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 get_picture_0_1_->texture_target = texture_target; 576 get_picture_0_1_->texture_target = texture_target;
577 get_picture_0_1_->texture_size = texture_size; 577 get_picture_0_1_->texture_size = texture_size;
578 get_picture_0_1_ = NULL; 578 get_picture_0_1_ = NULL;
579 } 579 }
580 580
581 received_pictures_.pop(); 581 received_pictures_.pop();
582 } 582 }
583 583
584 } // namespace proxy 584 } // namespace proxy
585 } // namespace ppapi 585 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/serialized_handle.cc ('k') | ui/gfx/gpu_memory_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698