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/shared_impl/resource_var.h"
7 #include "ppapi/shared_impl/ppapi_globals.h"
8 #include "ppapi/shared_impl/var_tracker.h"
12 int ResourceVar::GetPendingRendererHostId() const {
16 int ResourceVar::GetPendingBrowserHostId() const {
20 const IPC::Message
* ResourceVar::GetCreationMessage() const {
24 ResourceVar
* ResourceVar::AsResourceVar() {
28 PP_VarType
ResourceVar::GetType() const {
29 return PP_VARTYPE_RESOURCE
;
33 ResourceVar
* ResourceVar::FromPPVar(PP_Var var
) {
34 if (var
.type
!= PP_VARTYPE_RESOURCE
)
36 scoped_refptr
<Var
> var_object(
37 PpapiGlobals::Get()->GetVarTracker()->GetVar(var
));
38 if (!var_object
.get())
40 return var_object
->AsResourceVar();
43 ResourceVar::ResourceVar() {}
45 ResourceVar::~ResourceVar() {}