Make DesktopResizer use ScreenResolution to facilitate DPI-awareness.
[chromium-blink-merge.git] / ppapi / shared_impl / resource_var.cc
blob1260843a28aa73100a4674c118273cf73d229342
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"
10 namespace ppapi {
12 int ResourceVar::GetPendingRendererHostId() const {
13 return 0;
16 int ResourceVar::GetPendingBrowserHostId() const {
17 return 0;
20 const IPC::Message* ResourceVar::GetCreationMessage() const {
21 return NULL;
24 ResourceVar* ResourceVar::AsResourceVar() {
25 return this;
28 PP_VarType ResourceVar::GetType() const {
29 return PP_VARTYPE_RESOURCE;
32 // static
33 ResourceVar* ResourceVar::FromPPVar(PP_Var var) {
34 if (var.type != PP_VARTYPE_RESOURCE)
35 return NULL;
36 scoped_refptr<Var> var_object(
37 PpapiGlobals::Get()->GetVarTracker()->GetVar(var));
38 if (!var_object.get())
39 return NULL;
40 return var_object->AsResourceVar();
43 ResourceVar::ResourceVar() {}
45 ResourceVar::~ResourceVar() {}
47 } // namespace ppapi