Remove Observer methods in RTCVideoEncoderFactory.
[chromium-blink-merge.git] / ppapi / thunk / ppb_image_capture_config_private_thunk.cc
bloba97251b60961638043569b9bbede39e3fed4afd8
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // From private/ppb_image_capture_config_private.idl,
6 // modified Wed Aug 13 14:07:52 2014.
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_image_capture_config_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_image_capture_config_api.h"
15 namespace ppapi {
16 namespace thunk {
18 namespace {
20 PP_Resource Create(PP_Instance instance) {
21 VLOG(4) << "PPB_ImageCaptureConfig_Private::Create()";
22 EnterResourceCreation enter(instance);
23 if (enter.failed())
24 return 0;
25 return enter.functions()->CreateImageCaptureConfigPrivate(instance);
28 PP_Bool IsImageCaptureConfig(PP_Resource resource) {
29 VLOG(4) << "PPB_ImageCaptureConfig_Private::IsImageCaptureConfig()";
30 EnterResource<PPB_ImageCaptureConfig_API> enter(resource, false);
31 return PP_FromBool(enter.succeeded());
34 void GetPreviewSize(PP_Resource config, struct PP_Size* preview_size) {
35 VLOG(4) << "PPB_ImageCaptureConfig_Private::GetPreviewSize()";
36 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
37 if (enter.failed())
38 return;
39 enter.object()->GetPreviewSize(preview_size);
42 void SetPreviewSize(PP_Resource config, const struct PP_Size* preview_size) {
43 VLOG(4) << "PPB_ImageCaptureConfig_Private::SetPreviewSize()";
44 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
45 if (enter.failed())
46 return;
47 enter.object()->SetPreviewSize(preview_size);
50 void GetJpegSize(PP_Resource config, struct PP_Size* jpeg_size) {
51 VLOG(4) << "PPB_ImageCaptureConfig_Private::GetJpegSize()";
52 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
53 if (enter.failed())
54 return;
55 enter.object()->GetJpegSize(jpeg_size);
58 void SetJpegSize(PP_Resource config, const struct PP_Size* jpeg_size) {
59 VLOG(4) << "PPB_ImageCaptureConfig_Private::SetJpegSize()";
60 EnterResource<PPB_ImageCaptureConfig_API> enter(config, true);
61 if (enter.failed())
62 return;
63 enter.object()->SetJpegSize(jpeg_size);
66 const PPB_ImageCaptureConfig_Private_0_1
67 g_ppb_imagecaptureconfig_private_thunk_0_1 = {
68 &Create,
69 &IsImageCaptureConfig,
70 &GetPreviewSize,
71 &SetPreviewSize,
72 &GetJpegSize,
73 &SetJpegSize
76 } // namespace
78 PPAPI_THUNK_EXPORT const PPB_ImageCaptureConfig_Private_0_1*
79 GetPPB_ImageCaptureConfig_Private_0_1_Thunk() {
80 return &g_ppb_imagecaptureconfig_private_thunk_0_1;
83 } // namespace thunk
84 } // namespace ppapi