Home | History | Annotate | Download | only in shared_impl
      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 
     12 int ResourceVar::GetPendingRendererHostId() const { return 0; }
     13 
     14 int ResourceVar::GetPendingBrowserHostId() const { return 0; }
     15 
     16 const IPC::Message* ResourceVar::GetCreationMessage() const { return NULL; }
     17 
     18 ResourceVar* ResourceVar::AsResourceVar() { return this; }
     19 
     20 PP_VarType ResourceVar::GetType() const { return PP_VARTYPE_RESOURCE; }
     21 
     22 // static
     23 ResourceVar* 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 
     33 ResourceVar::ResourceVar() {}
     34 
     35 ResourceVar::~ResourceVar() {}
     36 
     37 }  // namespace ppapi
     38