Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ppapi / shared_impl / ppb_device_ref_shared.cc
blob81d887831b820d6d19d99bb516988f6114da9d16
1 // Copyright (c) 2012 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/ppb_device_ref_shared.h"
7 #include "ppapi/shared_impl/host_resource.h"
8 #include "ppapi/shared_impl/ppapi_globals.h"
9 #include "ppapi/shared_impl/resource_tracker.h"
10 #include "ppapi/shared_impl/var.h"
12 using ppapi::thunk::PPB_DeviceRef_API;
14 namespace ppapi {
16 DeviceRefData::DeviceRefData() : type(PP_DEVICETYPE_DEV_INVALID) {}
18 PPB_DeviceRef_Shared::PPB_DeviceRef_Shared(ResourceObjectType type,
19 PP_Instance instance,
20 const DeviceRefData& data)
21 : Resource(type, instance), data_(data) {}
23 PPB_DeviceRef_API* PPB_DeviceRef_Shared::AsPPB_DeviceRef_API() { return this; }
25 const DeviceRefData& PPB_DeviceRef_Shared::GetDeviceRefData() const {
26 return data_;
29 PP_DeviceType_Dev PPB_DeviceRef_Shared::GetType() { return data_.type; }
31 PP_Var PPB_DeviceRef_Shared::GetName() {
32 return StringVar::StringToPPVar(data_.name);
35 } // namespace ppapi