1 // Copyright (c) 2013 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 #include "ppapi/c/ppb_var_array.h"
6 #include "ppapi/shared_impl/array_var.h"
7 #include "ppapi/shared_impl/proxy_lock.h"
8 #include "ppapi/thunk/thunk.h"
18 // Var tracker will hold a reference to this object.
19 ArrayVar
* var
= new ArrayVar();
20 return var
->GetPPVar();
23 PP_Var
Get(PP_Var array
, uint32_t index
) {
26 ArrayVar
* array_var
= ArrayVar::FromPPVar(array
);
28 return PP_MakeUndefined();
29 return array_var
->Get(index
);
32 PP_Bool
Set(PP_Var array
, uint32_t index
, PP_Var value
) {
35 ArrayVar
* array_var
= ArrayVar::FromPPVar(array
);
38 return array_var
->Set(index
, value
);
41 uint32_t GetLength(PP_Var array
) {
44 ArrayVar
* array_var
= ArrayVar::FromPPVar(array
);
47 return array_var
->GetLength();
50 PP_Bool
SetLength(PP_Var array
, uint32_t length
) {
53 ArrayVar
* array_var
= ArrayVar::FromPPVar(array
);
56 return array_var
->SetLength(length
);
59 const PPB_VarArray_1_0 g_ppb_vararray_1_0_thunk
= {
69 const PPB_VarArray_1_0
* GetPPB_VarArray_1_0_Thunk() {
70 return &g_ppb_vararray_1_0_thunk
;