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

Unified Diff: ppapi/thunk/ppb_image_capture_config_private_thunk.cc

Issue 391323002: Pepper: add Image Capture interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 6 years, 4 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/thunk/ppb_image_capture_config_private_thunk.cc
diff --git a/ppapi/thunk/ppb_image_capture_config_private_thunk.cc b/ppapi/thunk/ppb_image_capture_config_private_thunk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a97251b60961638043569b9bbede39e3fed4afd8
--- /dev/null
+++ b/ppapi/thunk/ppb_image_capture_config_private_thunk.cc
@@ -0,0 +1,84 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// 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_config_private.idl,
+// modified Wed Aug 13 14:07:52 2014.
+
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/private/ppb_image_capture_config_private.h"
+#include "ppapi/shared_impl/tracked_callback.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppapi_thunk_export.h"
+#include "ppapi/thunk/ppb_image_capture_config_api.h"
Justin Chuang 2014/08/15 09:39:38 Missing *_api.h files.
wuchengli 2014/08/17 07:07:09 I'll leave those to you. :)
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+PP_Resource Create(PP_Instance instance) {
+ VLOG(4) << "PPB_ImageCaptureConfig_Private::Create()";
+ EnterResourceCreation enter(instance);
+ if (enter.failed())
+ return 0;
+ return enter.functions()->CreateImageCaptureConfigPrivate(instance);
+}
+
+PP_Bool IsImageCaptureConfig(PP_Resource resource) {
+ VLOG(4) << "PPB_ImageCaptureConfig_Private::IsImageCaptureConfig()";
+ EnterResource<PPB_ImageCaptureConfig_API> enter(resource, false);
+ return PP_FromBool(enter.succeeded());
+}
+
+void GetPreviewSize(PP_Resource config, struct PP_Size* preview_size) {
+ VLOG(4) << "PPB_ImageCaptureConfig_Private::GetPreviewSize()";
+ EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
+ if (enter.failed())
+ return;
+ enter.object()->GetPreviewSize(preview_size);
+}
+
+void SetPreviewSize(PP_Resource config, const struct PP_Size* preview_size) {
+ VLOG(4) << "PPB_ImageCaptureConfig_Private::SetPreviewSize()";
+ EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
+ if (enter.failed())
+ return;
+ enter.object()->SetPreviewSize(preview_size);
+}
+
+void GetJpegSize(PP_Resource config, struct PP_Size* jpeg_size) {
+ VLOG(4) << "PPB_ImageCaptureConfig_Private::GetJpegSize()";
+ EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
+ if (enter.failed())
+ return;
+ enter.object()->GetJpegSize(jpeg_size);
+}
+
+void SetJpegSize(PP_Resource config, const struct PP_Size* jpeg_size) {
+ VLOG(4) << "PPB_ImageCaptureConfig_Private::SetJpegSize()";
+ EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
+ if (enter.failed())
+ return;
+ enter.object()->SetJpegSize(jpeg_size);
+}
+
+const PPB_ImageCaptureConfig_Private_0_1
+ g_ppb_imagecaptureconfig_private_thunk_0_1 = {
+ &Create,
+ &IsImageCaptureConfig,
+ &GetPreviewSize,
+ &SetPreviewSize,
+ &GetJpegSize,
+ &SetJpegSize
+};
+
+} // namespace
+
+PPAPI_THUNK_EXPORT const PPB_ImageCaptureConfig_Private_0_1*
+ GetPPB_ImageCaptureConfig_Private_0_1_Thunk() {
+ return &g_ppb_imagecaptureconfig_private_thunk_0_1;
+}
+
+} // namespace thunk
+} // namespace ppapi
« no previous file with comments | « ppapi/thunk/ppb_camera_capabilities_private_thunk.cc ('k') | ppapi/thunk/ppb_image_capture_private_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698