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 { return 0; }
14 int ResourceVar::GetPendingBrowserHostId() const { return 0; }
16 const IPC::Message
* ResourceVar::GetCreationMessage() const { return NULL
; }
18 ResourceVar
* ResourceVar::AsResourceVar() { return this; }
20 PP_VarType
ResourceVar::GetType() const { return PP_VARTYPE_RESOURCE
; }
23 ResourceVar
* ResourceVar::FromPPVar(PP_Var var
) {
24 if (var
.type
!= PP_VARTYPE_RESOURCE
)
26 scoped_refptr
<Var
> var_object(
27 PpapiGlobals::Get()->GetVarTracker()->GetVar(var
));
28 if (!var_object
.get())
30 return var_object
->AsResourceVar();
33 ResourceVar::ResourceVar() {}
35 ResourceVar::~ResourceVar() {}