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

Unified Diff: ppapi/thunk/ppb_image_capture_private_thunk.cc

Issue 848863002: PPAPI: implement GetSupportedPreviewSizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo: int32->int32_t Created 5 years, 10 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
« no previous file with comments | « ppapi/thunk/ppb_image_capture_api.h ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_image_capture_private_thunk.cc
diff --git a/ppapi/thunk/ppb_image_capture_private_thunk.cc b/ppapi/thunk/ppb_image_capture_private_thunk.cc
index 47db157271fb0e34d450e2cfa0f9e2753df2b372..2b55183a7df433b54316ea10aa5e6428bcefb447 100644
--- a/ppapi/thunk/ppb_image_capture_private_thunk.cc
+++ b/ppapi/thunk/ppb_image_capture_private_thunk.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// From private/ppb_image_capture_private.idl modified Thu Feb 5 22:47:43 2015.
+// From private/ppb_image_capture_private.idl modified Fri Feb 6 14:55:55 2015.
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
@@ -17,15 +17,12 @@ namespace thunk {
namespace {
-PP_Resource Create(PP_Instance instance,
- struct PP_Var camera_source_id,
- void* user_data) {
+PP_Resource Create(PP_Instance instance) {
VLOG(4) << "PPB_ImageCapture_Private::Create()";
EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
- return enter.functions()->CreateImageCapturePrivate(
- instance, camera_source_id, user_data);
+ return enter.functions()->CreateImageCapturePrivate(instance);
}
PP_Bool IsImageCapture(PP_Resource resource) {
@@ -34,12 +31,22 @@ PP_Bool IsImageCapture(PP_Resource resource) {
return PP_FromBool(enter.succeeded());
}
-int32_t Close(PP_Resource resource, struct PP_CompletionCallback callback) {
- VLOG(4) << "PPB_ImageCapture_Private::Close()";
- EnterResource<PPB_ImageCapture_API> enter(resource, callback, true);
+int32_t Open(PP_Resource image_capture,
+ struct PP_Var device_id,
+ struct PP_CompletionCallback callback) {
+ VLOG(4) << "PPB_ImageCapture_Private::Open()";
+ EnterResource<PPB_ImageCapture_API> enter(image_capture, callback, true);
if (enter.failed())
return enter.retval();
- return enter.SetResult(enter.object()->Close(enter.callback()));
+ return enter.SetResult(enter.object()->Open(device_id, enter.callback()));
+}
+
+void Close(PP_Resource image_capture) {
+ VLOG(4) << "PPB_ImageCapture_Private::Close()";
+ EnterResource<PPB_ImageCapture_API> enter(image_capture, true);
+ if (enter.failed())
+ return;
+ enter.object()->Close();
}
int32_t GetCameraCapabilities(PP_Resource image_capture,
@@ -54,7 +61,7 @@ int32_t GetCameraCapabilities(PP_Resource image_capture,
}
const PPB_ImageCapture_Private_0_1 g_ppb_imagecapture_private_thunk_0_1 =
- {&Create, &IsImageCapture, &Close, &GetCameraCapabilities};
+ {&Create, &IsImageCapture, &Open, &Close, &GetCameraCapabilities};
} // namespace
« no previous file with comments | « ppapi/thunk/ppb_image_capture_api.h ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698