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

Side by Side Diff: content/renderer/pepper/pepper_video_capture_host.cc

Issue 281803003: Add PPAPI_BEGIN_MESSAGE_MAP and PPAPI_END_MESSAGE_MAP to be used when dispatching IPCs using PPAPI_… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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 | Annotate | Revision Log
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 "content/renderer/pepper/pepper_video_capture_host.h" 5 #include "content/renderer/pepper/pepper_video_capture_host.h"
6 6
7 #include "content/renderer/pepper/host_globals.h" 7 #include "content/renderer/pepper/host_globals.h"
8 #include "content/renderer/pepper/pepper_media_device_manager.h" 8 #include "content/renderer/pepper/pepper_media_device_manager.h"
9 #include "content/renderer/pepper/pepper_platform_video_capture.h" 9 #include "content/renderer/pepper/pepper_platform_video_capture.h"
10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return !!renderer_ppapi_host_->GetPluginInstance(pp_instance()); 56 return !!renderer_ppapi_host_->GetPluginInstance(pp_instance());
57 } 57 }
58 58
59 int32_t PepperVideoCaptureHost::OnResourceMessageReceived( 59 int32_t PepperVideoCaptureHost::OnResourceMessageReceived(
60 const IPC::Message& msg, 60 const IPC::Message& msg,
61 ppapi::host::HostMessageContext* context) { 61 ppapi::host::HostMessageContext* context) {
62 int32_t result = PP_ERROR_FAILED; 62 int32_t result = PP_ERROR_FAILED;
63 if (enumeration_helper_.HandleResourceMessage(msg, context, &result)) 63 if (enumeration_helper_.HandleResourceMessage(msg, context, &result))
64 return result; 64 return result;
65 65
66 IPC_BEGIN_MESSAGE_MAP(PepperVideoCaptureHost, msg) 66 PPAPI_BEGIN_MESSAGE_MAP(PepperVideoCaptureHost, msg)
67 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoCapture_Open, OnOpen) 67 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoCapture_Open, OnOpen)
68 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoCapture_StartCapture, 68 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoCapture_StartCapture,
69 OnStartCapture) 69 OnStartCapture)
70 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoCapture_ReuseBuffer, 70 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_VideoCapture_ReuseBuffer,
71 OnReuseBuffer) 71 OnReuseBuffer)
72 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoCapture_StopCapture, 72 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoCapture_StopCapture,
73 OnStopCapture) 73 OnStopCapture)
74 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoCapture_Close, OnClose) 74 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoCapture_Close,
75 IPC_END_MESSAGE_MAP() 75 OnClose)
76 PPAPI_END_MESSAGE_MAP()
76 return PP_ERROR_FAILED; 77 return PP_ERROR_FAILED;
77 } 78 }
78 79
79 void PepperVideoCaptureHost::OnInitialized(bool succeeded) { 80 void PepperVideoCaptureHost::OnInitialized(bool succeeded) {
80 if (succeeded) { 81 if (succeeded) {
81 open_reply_context_.params.set_result(PP_OK); 82 open_reply_context_.params.set_result(PP_OK);
82 } else { 83 } else {
83 DetachPlatformVideoCapture(); 84 DetachPlatformVideoCapture();
84 open_reply_context_.params.set_result(PP_ERROR_FAILED); 85 open_reply_context_.params.set_result(PP_ERROR_FAILED);
85 } 86 }
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 412 }
412 413
413 PepperVideoCaptureHost::BufferInfo::BufferInfo() 414 PepperVideoCaptureHost::BufferInfo::BufferInfo()
414 : in_use(false), data(NULL), buffer() { 415 : in_use(false), data(NULL), buffer() {
415 } 416 }
416 417
417 PepperVideoCaptureHost::BufferInfo::~BufferInfo() { 418 PepperVideoCaptureHost::BufferInfo::~BufferInfo() {
418 } 419 }
419 420
420 } // namespace content 421 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698