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

Side by Side Diff: ppapi/thunk/ppb_camera_capabilities_private_thunk.cc

Issue 490433002: PPAPI: make generator output a pointer to an array correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 // From private/ppb_camera_capabilities_private.idl, 5 // From private/ppb_camera_capabilities_private.idl,
6 // modified Wed Aug 13 14:08:24 2014. 6 // modified Tue Aug 19 14:43:34 2014.
7 7
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_camera_capabilities_private.h" 9 #include "ppapi/c/private/ppb_camera_capabilities_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h" 12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_camera_capabilities_api.h" 13 #include "ppapi/thunk/ppb_camera_capabilities_api.h"
14 14
15 namespace ppapi { 15 namespace ppapi {
16 namespace thunk { 16 namespace thunk {
17 17
18 namespace { 18 namespace {
19 19
20 PP_Resource Create(PP_Instance instance) { 20 PP_Resource Create(PP_Instance instance) {
21 VLOG(4) << "PPB_CameraCapabilities_Private::Create()"; 21 VLOG(4) << "PPB_CameraCapabilities_Private::Create()";
22 EnterResourceCreation enter(instance); 22 EnterResourceCreation enter(instance);
23 if (enter.failed()) 23 if (enter.failed())
24 return 0; 24 return 0;
25 return enter.functions()->CreateCameraCapabilitiesPrivate(instance); 25 return enter.functions()->CreateCameraCapabilitiesPrivate(instance);
26 } 26 }
27 27
28 PP_Bool IsCameraCapabilities(PP_Resource resource) { 28 PP_Bool IsCameraCapabilities(PP_Resource resource) {
29 VLOG(4) << "PPB_CameraCapabilities_Private::IsCameraCapabilities()"; 29 VLOG(4) << "PPB_CameraCapabilities_Private::IsCameraCapabilities()";
30 EnterResource<PPB_CameraCapabilities_API> enter(resource, false); 30 EnterResource<PPB_CameraCapabilities_API> enter(resource, false);
31 return PP_FromBool(enter.succeeded()); 31 return PP_FromBool(enter.succeeded());
32 } 32 }
33 33
34 void GetSupportedPreviewSizes(PP_Resource capabilities, 34 void GetSupportedPreviewSizes(PP_Resource capabilities,
35 int32_t* array_size, 35 int32_t* array_size,
36 struct PP_Size* preview_sizes[]) { 36 struct PP_Size** preview_sizes) {
37 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedPreviewSizes()"; 37 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedPreviewSizes()";
38 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true); 38 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
39 if (enter.failed()) 39 if (enter.failed())
40 return; 40 return;
41 enter.object()->GetSupportedPreviewSizes(array_size, preview_sizes); 41 enter.object()->GetSupportedPreviewSizes(array_size, preview_sizes);
42 } 42 }
43 43
44 void GetSupportedJpegSizes(PP_Resource capabilities, 44 void GetSupportedJpegSizes(PP_Resource capabilities,
45 int32_t* array_size, 45 int32_t* array_size,
46 struct PP_Size* jpeg_sizes[]) { 46 struct PP_Size** jpeg_sizes) {
47 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedJpegSizes()"; 47 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedJpegSizes()";
48 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true); 48 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
49 if (enter.failed()) 49 if (enter.failed())
50 return; 50 return;
51 enter.object()->GetSupportedJpegSizes(array_size, jpeg_sizes); 51 enter.object()->GetSupportedJpegSizes(array_size, jpeg_sizes);
52 } 52 }
53 53
54 const PPB_CameraCapabilities_Private_0_1 54 const PPB_CameraCapabilities_Private_0_1
55 g_ppb_cameracapabilities_private_thunk_0_1 = { 55 g_ppb_cameracapabilities_private_thunk_0_1 = {
56 &Create, 56 &Create,
57 &IsCameraCapabilities, 57 &IsCameraCapabilities,
58 &GetSupportedPreviewSizes, 58 &GetSupportedPreviewSizes,
59 &GetSupportedJpegSizes 59 &GetSupportedJpegSizes
60 }; 60 };
61 61
62 } // namespace 62 } // namespace
63 63
64 PPAPI_THUNK_EXPORT const PPB_CameraCapabilities_Private_0_1* 64 PPAPI_THUNK_EXPORT const PPB_CameraCapabilities_Private_0_1*
65 GetPPB_CameraCapabilities_Private_0_1_Thunk() { 65 GetPPB_CameraCapabilities_Private_0_1_Thunk() {
66 return &g_ppb_cameracapabilities_private_thunk_0_1; 66 return &g_ppb_cameracapabilities_private_thunk_0_1;
67 } 67 }
68 68
69 } // namespace thunk 69 } // namespace thunk
70 } // namespace ppapi 70 } // namespace ppapi
OLDNEW
« ppapi/generators/idl_c_proto.py ('K') | « ppapi/generators/idl_c_proto.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698