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/cpp/private/flash_device_id.h"
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/private/ppb_flash_device_id.h"
9 #include "ppapi/cpp/module_impl.h"
15 template <> const char* interface_name
<PPB_Flash_DeviceID_1_0
>() {
16 return PPB_FLASH_DEVICEID_INTERFACE_1_0
;
23 DeviceID::DeviceID() {
26 DeviceID::DeviceID(const InstanceHandle
& instance
) : Resource() {
27 if (has_interface
<PPB_Flash_DeviceID_1_0
>()) {
28 PassRefFromConstructor(get_interface
<PPB_Flash_DeviceID_1_0
>()->Create(
29 instance
.pp_instance()));
33 int32_t DeviceID::GetDeviceID(
34 const CompletionCallbackWithOutput
<Var
>& callback
) {
35 if (has_interface
<PPB_Flash_DeviceID_1_0
>()) {
36 return get_interface
<PPB_Flash_DeviceID_1_0
>()->GetDeviceID(
39 callback
.pp_completion_callback());
41 return callback
.MayForce(PP_ERROR_NOINTERFACE
);