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. 4 5 #include "ppapi/shared_impl/resource_var.h" 6 7 #include "ppapi/shared_impl/ppapi_globals.h" 8 #include "ppapi/shared_impl/var_tracker.h" 9 10 namespace ppapi { 11 GetPendingRendererHostId() const12int ResourceVar::GetPendingRendererHostId() const { return 0; } 13 GetPendingBrowserHostId() const14int ResourceVar::GetPendingBrowserHostId() const { return 0; } 15 GetCreationMessage() const16const IPC::Message* ResourceVar::GetCreationMessage() const { return NULL; } 17 AsResourceVar()18ResourceVar* ResourceVar::AsResourceVar() { return this; } 19 GetType() const20PP_VarType ResourceVar::GetType() const { return PP_VARTYPE_RESOURCE; } 21 22 // static FromPPVar(PP_Var var)23ResourceVar* ResourceVar::FromPPVar(PP_Var var) { 24 if (var.type != PP_VARTYPE_RESOURCE) 25 return NULL; 26 scoped_refptr<Var> var_object( 27 PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); 28 if (!var_object.get()) 29 return NULL; 30 return var_object->AsResourceVar(); 31 } 32 ResourceVar()33ResourceVar::ResourceVar() {} 34 ~ResourceVar()35ResourceVar::~ResourceVar() {} 36 37 } // namespace ppapi 38