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
;
16 DeviceRefData::DeviceRefData() : type(PP_DEVICETYPE_DEV_INVALID
) {}
18 PPB_DeviceRef_Shared::PPB_DeviceRef_Shared(ResourceObjectType type
,
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 {
29 PP_DeviceType_Dev
PPB_DeviceRef_Shared::GetType() { return data_
.type
; }
31 PP_Var
PPB_DeviceRef_Shared::GetName() {
32 return StringVar::StringToPPVar(data_
.name
);