[telemetry] Ensure gsutil is a file.
[chromium-blink-merge.git] / ppapi / shared_impl / ppb_device_ref_shared.cc
blob1b458734ae8a06763df92c5920a3a34035177dc1
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()
17 : type(PP_DEVICETYPE_DEV_INVALID) {
20 PPB_DeviceRef_Shared::PPB_DeviceRef_Shared(ResourceObjectType type,
21 PP_Instance instance,
22 const DeviceRefData& data)
23 : Resource(type, instance),
24 data_(data) {
27 PPB_DeviceRef_API* PPB_DeviceRef_Shared::AsPPB_DeviceRef_API() {
28 return this;
31 const DeviceRefData& PPB_DeviceRef_Shared::GetDeviceRefData() const {
32 return data_;
35 PP_DeviceType_Dev PPB_DeviceRef_Shared::GetType() {
36 return data_.type;
39 PP_Var PPB_DeviceRef_Shared::GetName() {
40 return StringVar::StringToPPVar(data_.name);
43 } // namespace ppapi