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

Unified Diff: ppapi/proxy/ppb_video_capture_proxy.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated TestURLLoader to test blocking callbacks. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/ppb_video_capture_proxy.cc
diff --git a/ppapi/proxy/ppb_video_capture_proxy.cc b/ppapi/proxy/ppb_video_capture_proxy.cc
index 6a51299bd66b82fc34087769d4858201e059dff9..2214dbcc44aae7362eec3a55af1c39dad23fc5af 100644
--- a/ppapi/proxy/ppb_video_capture_proxy.cc
+++ b/ppapi/proxy/ppb_video_capture_proxy.cc
@@ -162,14 +162,13 @@ class VideoCapture : public PPB_VideoCapture_Shared {
private:
// PPB_VideoCapture_Shared implementation.
- virtual int32_t InternalEnumerateDevices(
- PP_Resource* devices,
- const PP_CompletionCallback& callback) OVERRIDE;
+ virtual int32_t InternalEnumerateDevices(PP_Resource* devices,
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t InternalOpen(
const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- const PP_CompletionCallback& callback) OVERRIDE;
+ ApiCallbackType callback) OVERRIDE;
virtual int32_t InternalStartCapture() OVERRIDE;
virtual int32_t InternalReuseBuffer(uint32_t buffer) OVERRIDE;
virtual int32_t InternalStopCapture() OVERRIDE;
@@ -213,10 +212,10 @@ bool VideoCapture::OnStatus(PP_VideoCaptureStatus_Dev status) {
return false;
}
-int32_t VideoCapture::InternalEnumerateDevices(
- PP_Resource* devices, const PP_CompletionCallback& callback) {
+int32_t VideoCapture::InternalEnumerateDevices(PP_Resource* devices,
+ ApiCallbackType callback) {
devices_ = devices;
- enumerate_devices_callback_ = new TrackedCallback(this, callback);
+ enumerate_devices_callback_ = callback;
GetDispatcher()->Send(new PpapiHostMsg_PPBVideoCapture_EnumerateDevices(
API_ID_PPB_VIDEO_CAPTURE_DEV, host_resource()));
return PP_OK_COMPLETIONPENDING;
@@ -226,12 +225,8 @@ int32_t VideoCapture::InternalOpen(
const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- const PP_CompletionCallback& callback) {
- // Disallow blocking call. The base class doesn't check this.
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
-
- open_callback_ = new TrackedCallback(this, callback);
+ ApiCallbackType callback) {
+ open_callback_ = callback;
GetDispatcher()->Send(new PpapiHostMsg_PPBVideoCapture_Open(
API_ID_PPB_VIDEO_CAPTURE_DEV, host_resource(), device_id, requested_info,
buffer_count));

Powered by Google App Engine
This is Rietveld 408576698