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

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

Issue 11365235: Add PPAPI permissions for file chooser, PDF, testing, video capture, and video decode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.cc ('k') | ppapi/proxy/ppb_video_decoder_proxy.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/ppb_video_capture_proxy.h" 5 #include "ppapi/proxy/ppb_video_capture_proxy.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 HostResource result; 295 HostResource result;
296 dispatcher->Send(new PpapiHostMsg_PPBVideoCapture_Create( 296 dispatcher->Send(new PpapiHostMsg_PPBVideoCapture_Create(
297 API_ID_PPB_VIDEO_CAPTURE_DEV, instance, &result)); 297 API_ID_PPB_VIDEO_CAPTURE_DEV, instance, &result));
298 if (result.is_null()) 298 if (result.is_null())
299 return 0; 299 return 0;
300 return (new VideoCapture(result))->GetReference(); 300 return (new VideoCapture(result))->GetReference();
301 } 301 }
302 302
303 bool PPB_VideoCapture_Proxy::OnMessageReceived(const IPC::Message& msg) { 303 bool PPB_VideoCapture_Proxy::OnMessageReceived(const IPC::Message& msg) {
304 if (!dispatcher()->permissions().HasPermission(PERMISSION_DEV))
305 return false;
306
304 bool handled = true; 307 bool handled = true;
305 IPC_BEGIN_MESSAGE_MAP(PPB_VideoCapture_Proxy, msg) 308 IPC_BEGIN_MESSAGE_MAP(PPB_VideoCapture_Proxy, msg)
306 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_Create, OnMsgCreate) 309 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_Create, OnMsgCreate)
307 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_EnumerateDevices, 310 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_EnumerateDevices,
308 OnMsgEnumerateDevices) 311 OnMsgEnumerateDevices)
309 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_Open, OnMsgOpen) 312 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_Open, OnMsgOpen)
310 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_StartCapture, 313 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_StartCapture,
311 OnMsgStartCapture) 314 OnMsgStartCapture)
312 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_ReuseBuffer, 315 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVideoCapture_ReuseBuffer,
313 OnMsgReuseBuffer) 316 OnMsgReuseBuffer)
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 return; 536 return;
534 537
535 VideoCapture* capture = static_cast<VideoCapture*>(enter.object()); 538 VideoCapture* capture = static_cast<VideoCapture*>(enter.object());
536 capture->SetBufferInUse(buffer); 539 capture->SetBufferInUse(buffer);
537 ppp_video_capture_impl_->OnBufferReady( 540 ppp_video_capture_impl_->OnBufferReady(
538 host_resource.instance(), capture->pp_resource(), buffer); 541 host_resource.instance(), capture->pp_resource(), buffer);
539 } 542 }
540 543
541 } // namespace proxy 544 } // namespace proxy
542 } // namespace ppapi 545 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_testing_proxy.cc ('k') | ppapi/proxy/ppb_video_decoder_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698