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

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

Issue 148213016: [PPAPI] Moving pp::VarResource_Dev API into pp::Var (now stable). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 2013 The Chromium Authors. All rights reserved. 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 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 #include "ppapi/c/dev/ppb_var_resource_dev.h"
6 #include "ppapi/c/pp_var.h" 5 #include "ppapi/c/pp_var.h"
6 #include "ppapi/c/ppb_var_resource.h"
7 #include "ppapi/shared_impl/ppapi_globals.h" 7 #include "ppapi/shared_impl/ppapi_globals.h"
8 #include "ppapi/shared_impl/proxy_lock.h" 8 #include "ppapi/shared_impl/proxy_lock.h"
9 #include "ppapi/shared_impl/resource_tracker.h" 9 #include "ppapi/shared_impl/resource_tracker.h"
10 #include "ppapi/shared_impl/resource_var.h" 10 #include "ppapi/shared_impl/resource_var.h"
11 #include "ppapi/shared_impl/var_tracker.h" 11 #include "ppapi/shared_impl/var_tracker.h"
12 #include "ppapi/thunk/thunk.h" 12 #include "ppapi/thunk/thunk.h"
13 13
14 namespace ppapi { 14 namespace ppapi {
15 namespace thunk { 15 namespace thunk {
16 16
17 namespace { 17 namespace {
18 18
19 PP_Resource VarToResource(struct PP_Var var) { 19 PP_Resource VarToResource(struct PP_Var var) {
20 ProxyAutoLock lock; 20 ProxyAutoLock lock;
21 ResourceVar* resource = ResourceVar::FromPPVar(var); 21 ResourceVar* resource = ResourceVar::FromPPVar(var);
22 if (!resource) 22 if (!resource)
23 return 0; 23 return 0;
24 PP_Resource pp_resource = resource->GetPPResource(); 24 PP_Resource pp_resource = resource->GetPPResource();
25 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(pp_resource); 25 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(pp_resource);
26 return pp_resource; 26 return pp_resource;
27 } 27 }
28 28
29 struct PP_Var VarFromResource(PP_Resource resource) { 29 struct PP_Var VarFromResource(PP_Resource resource) {
30 ProxyAutoLock lock; 30 ProxyAutoLock lock;
31 return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar(resource); 31 return PpapiGlobals::Get()->GetVarTracker()->MakeResourcePPVar(resource);
32 } 32 }
33 33
34 const PPB_VarResource_Dev_0_1 g_ppb_varresource_dev_0_1_thunk = { 34 const PPB_VarResource_1_0 g_ppb_varresource_1_0_thunk = {
35 &VarToResource, 35 &VarToResource,
36 &VarFromResource 36 &VarFromResource
37 }; 37 };
38 38
39 } // namespace 39 } // namespace
40 40
41 const PPB_VarResource_Dev_0_1* GetPPB_VarResource_Dev_0_1_Thunk() { 41 const PPB_VarResource_1_0* GetPPB_VarResource_1_0_Thunk() {
42 return &g_ppb_varresource_dev_0_1_thunk; 42 return &g_ppb_varresource_1_0_thunk;
43 } 43 }
44 44
45 } // namespace thunk 45 } // namespace thunk
46 } // namespace ppapi 46 } // namespace ppapi
OLDNEW
« ppapi/thunk/interfaces_ppb_public_dev.h ('K') | « ppapi/thunk/ppb_var_resource_dev_thunk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698