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

Side by Side Diff: ppapi/proxy/video_capture_resource.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
« no previous file with comments | « ppapi/proxy/udp_socket_filter.cc ('k') | ppapi/proxy/video_decoder_resource.h » ('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_capture_resource.h" 5 #include "ppapi/proxy/video_capture_resource.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ppapi/c/dev/ppp_video_capture_dev.h" 9 #include "ppapi/c/dev/ppp_video_capture_dev.h"
10 #include "ppapi/proxy/dispatch_reply_message.h" 10 #include "ppapi/proxy/dispatch_reply_message.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 uint32_t buffer_size) { 147 uint32_t buffer_size) {
148 if (!ppp_video_capture_impl_) 148 if (!ppp_video_capture_impl_)
149 return; 149 return;
150 150
151 std::vector<base::SharedMemoryHandle> handles; 151 std::vector<base::SharedMemoryHandle> handles;
152 params.TakeAllSharedMemoryHandles(&handles); 152 params.TakeAllSharedMemoryHandles(&handles);
153 CHECK(handles.size() == buffers.size()); 153 CHECK(handles.size() == buffers.size());
154 154
155 PluginResourceTracker* tracker = 155 PluginResourceTracker* tracker =
156 PluginGlobals::Get()->plugin_resource_tracker(); 156 PluginGlobals::Get()->plugin_resource_tracker();
157 scoped_ptr<PP_Resource[]> resources(new PP_Resource[buffers.size()]); 157 std::unique_ptr<PP_Resource[]> resources(new PP_Resource[buffers.size()]);
158 for (size_t i = 0; i < buffers.size(); ++i) { 158 for (size_t i = 0; i < buffers.size(); ++i) {
159 // We assume that the browser created a new set of resources. 159 // We assume that the browser created a new set of resources.
160 DCHECK(!tracker->PluginResourceForHostResource(buffers[i])); 160 DCHECK(!tracker->PluginResourceForHostResource(buffers[i]));
161 resources[i] = ppapi::proxy::PPB_Buffer_Proxy::AddProxyResource( 161 resources[i] = ppapi::proxy::PPB_Buffer_Proxy::AddProxyResource(
162 buffers[i], handles[i], buffer_size); 162 buffers[i], handles[i], buffer_size);
163 } 163 }
164 164
165 buffer_in_use_ = std::vector<bool>(buffers.size()); 165 buffer_in_use_ = std::vector<bool>(buffers.size());
166 166
167 CallWhileUnlocked(ppp_video_capture_impl_->OnDeviceInfo, 167 CallWhileUnlocked(ppp_video_capture_impl_->OnDeviceInfo,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 open_callback_->Run(params.result()); 227 open_callback_->Run(params.result());
228 } 228 }
229 229
230 void VideoCaptureResource::SetBufferInUse(uint32_t buffer_index) { 230 void VideoCaptureResource::SetBufferInUse(uint32_t buffer_index) {
231 CHECK(buffer_index < buffer_in_use_.size()); 231 CHECK(buffer_index < buffer_in_use_.size());
232 buffer_in_use_[buffer_index] = true; 232 buffer_in_use_[buffer_index] = true;
233 } 233 }
234 234
235 } // namespace proxy 235 } // namespace proxy
236 } // namespace ppapi 236 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/udp_socket_filter.cc ('k') | ppapi/proxy/video_decoder_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698