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

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

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 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
OLDNEW
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 "ppapi/proxy/media_stream_track_resource_base.h" 5 #include "ppapi/proxy/media_stream_track_resource_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 void MediaStreamTrackResourceBase::OnPluginMsgInitBuffers( 68 void MediaStreamTrackResourceBase::OnPluginMsgInitBuffers(
69 const ResourceMessageReplyParams& params, 69 const ResourceMessageReplyParams& params,
70 int32_t number_of_buffers, 70 int32_t number_of_buffers,
71 int32_t buffer_size, 71 int32_t buffer_size,
72 bool readonly) { 72 bool readonly) {
73 base::SharedMemoryHandle shm_handle = base::SharedMemory::NULLHandle(); 73 base::SharedMemoryHandle shm_handle = base::SharedMemory::NULLHandle();
74 params.TakeSharedMemoryHandleAtIndex(0, &shm_handle); 74 params.TakeSharedMemoryHandleAtIndex(0, &shm_handle);
75 buffer_manager_.SetBuffers(number_of_buffers, buffer_size, 75 buffer_manager_.SetBuffers(number_of_buffers, buffer_size,
76 scoped_ptr<base::SharedMemory>(new base::SharedMemory(shm_handle, 76 std::unique_ptr<base::SharedMemory>(
77 readonly)), 77 new base::SharedMemory(shm_handle, readonly)),
78 false); 78 false);
79 } 79 }
80 80
81 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffer( 81 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffer(
82 const ResourceMessageReplyParams& params, 82 const ResourceMessageReplyParams& params,
83 int32_t index) { 83 int32_t index) {
84 buffer_manager_.EnqueueBuffer(index); 84 buffer_manager_.EnqueueBuffer(index);
85 } 85 }
86 86
87 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffers( 87 void MediaStreamTrackResourceBase::OnPluginMsgEnqueueBuffers(
88 const ResourceMessageReplyParams& params, 88 const ResourceMessageReplyParams& params,
89 const std::vector<int32_t>& indices) { 89 const std::vector<int32_t>& indices) {
90 for (size_t i = 0; i < indices.size(); ++i) 90 for (size_t i = 0; i < indices.size(); ++i)
91 buffer_manager_.EnqueueBuffer(indices[i]); 91 buffer_manager_.EnqueueBuffer(indices[i]);
92 } 92 }
93 93
94 } // namespace proxy 94 } // namespace proxy
95 } // namespace ppapi 95 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/media_stream_audio_track_resource.cc ('k') | ppapi/proxy/media_stream_video_track_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698