1 // Copyright 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/dev/ppb_var_resource_dev.h"
6 #include "ppapi/c/pp_var.h"
7 #include "ppapi/shared_impl/ppapi_globals.h"
8 #include "ppapi/shared_impl/proxy_lock.h"
9 #include "ppapi/shared_impl/resource_tracker.h"
10 #include "ppapi/shared_impl/resource_var.h"
11 #include "ppapi/shared_impl/var_tracker.h"
12 #include "ppapi/thunk/thunk.h"
19 PP_Resource
VarToResource(struct PP_Var var
) {
21 ResourceVar
* resource
= ResourceVar::FromPPVar(var
);
24 PP_Resource pp_resource
= resource
->GetPPResource();
25 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(pp_resource
);
29 struct PP_Var
VarFromResource(PP_Resource resource
) {
31 return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar(resource
);
34 const PPB_VarResource_Dev_0_1 g_ppb_varresource_dev_0_1_thunk
= {
41 const PPB_VarResource_Dev_0_1
* GetPPB_VarResource_Dev_0_1_Thunk() {
42 return &g_ppb_varresource_dev_0_1_thunk
;