1 // Copyright (c) 2012 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 dev/ppb_resource_array_dev.idl modified Thu Dec 20 13:10:26 2012.
7 #include "ppapi/c/dev/ppb_resource_array_dev.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_instance_api.h"
12 #include "ppapi/thunk/ppb_resource_array_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
21 PP_Resource
Create(PP_Instance instance
,
22 const PP_Resource elements
[],
24 VLOG(4) << "PPB_ResourceArray_Dev::Create()";
25 EnterResourceCreation
enter(instance
);
28 return enter
.functions()->CreateResourceArray(instance
, elements
, size
);
31 PP_Bool
IsResourceArray(PP_Resource resource
) {
32 VLOG(4) << "PPB_ResourceArray_Dev::IsResourceArray()";
33 EnterResource
<PPB_ResourceArray_API
> enter(resource
, false);
34 return PP_FromBool(enter
.succeeded());
37 uint32_t GetSize(PP_Resource resource_array
) {
38 VLOG(4) << "PPB_ResourceArray_Dev::GetSize()";
39 EnterResource
<PPB_ResourceArray_API
> enter(resource_array
, true);
42 return enter
.object()->GetSize();
45 PP_Resource
GetAt(PP_Resource resource_array
, uint32_t index
) {
46 VLOG(4) << "PPB_ResourceArray_Dev::GetAt()";
47 EnterResource
<PPB_ResourceArray_API
> enter(resource_array
, true);
50 return enter
.object()->GetAt(index
);
53 const PPB_ResourceArray_Dev_0_1 g_ppb_resourcearray_dev_thunk_0_1
= {
62 const PPB_ResourceArray_Dev_0_1
* GetPPB_ResourceArray_Dev_0_1_Thunk() {
63 return &g_ppb_resourcearray_dev_thunk_0_1
;