Pepper_47_C++_interfaces
device_ref_dev.cc
Go to the documentation of this file.
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.
4 
6 
8 
9 namespace pp {
10 
11 namespace {
12 
13 template <> const char* interface_name<PPB_DeviceRef_Dev>() {
14  return PPB_DEVICEREF_DEV_INTERFACE;
15 }
16 
17 } // namespace
18 
20 }
21 
23 }
24 
26  : Resource(PASS_REF, resource) {
27 }
28 
30 }
31 
33 }
34 
35 PP_DeviceType_Dev DeviceRef_Dev::GetType() const {
36  if (!has_interface<PPB_DeviceRef_Dev>())
37  return PP_DEVICETYPE_DEV_INVALID;
38  return get_interface<PPB_DeviceRef_Dev>()->GetType(pp_resource());
39 }
40 
42  if (!has_interface<PPB_DeviceRef_Dev>())
43  return Var();
44  return Var(PASS_REF,
45  get_interface<PPB_DeviceRef_Dev>()->GetName(pp_resource()));
46 }
47 
48 } // namespace pp
PP_DeviceType_Dev GetType() const
Var GetName() const
PassRef
Definition: pass_ref.h:17
friend class Var
Definition: resource.h:90
PP_Resource pp_resource() const
Definition: resource.h:47
A generic type used for passing data types between the module and the page.
Definition: var.h:21
A reference counted module resource.
Definition: resource.h:20
virtual ~DeviceRef_Dev()