From 502ec4dda4411088ac46b55754a027235e4b9217 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Mon, 11 Jun 2012 20:45:01 +0000 Subject: Add an asynchronous version of the Flash DeviceID API. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10535062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141486 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/c/private/ppb_flash.h | 1 + ppapi/c/private/ppb_flash_device_id.h | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 ppapi/c/private/ppb_flash_device_id.h (limited to 'ppapi/c') diff --git a/ppapi/c/private/ppb_flash.h b/ppapi/c/private/ppb_flash.h index 1bde87b..94b4f85 100644 --- a/ppapi/c/private/ppb_flash.h +++ b/ppapi/c/private/ppb_flash.h @@ -175,6 +175,7 @@ struct PPB_Flash_12_4 { void (*UpdateActivity)(PP_Instance instance); /** * Returns the device ID as a string. Returns a PP_VARTYPE_UNDEFINED on error. + * Deprecated, use GetDeviceIDAsync. */ struct PP_Var (*GetDeviceID)(PP_Instance instance); /** diff --git a/ppapi/c/private/ppb_flash_device_id.h b/ppapi/c/private/ppb_flash_device_id.h new file mode 100644 index 0000000..33d1ba7 --- /dev/null +++ b/ppapi/c/private/ppb_flash_device_id.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From private/ppb_flash_device_id.idl modified Fri Jun 1 15:21:17 2012. */ + +#ifndef PPAPI_C_PRIVATE_PPB_FLASH_DEVICE_ID_H_ +#define PPAPI_C_PRIVATE_PPB_FLASH_DEVICE_ID_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_completion_callback.h" +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_resource.h" +#include "ppapi/c/pp_stdint.h" +#include "ppapi/c/pp_var.h" + +#define PPB_FLASH_DEVICEID_INTERFACE_1_0 "PPB_Flash_DeviceID;1.0" +#define PPB_FLASH_DEVICEID_INTERFACE PPB_FLASH_DEVICEID_INTERFACE_1_0 + +/** + * @file + * This file contains the PPB_Flash_DeviceID interface. + */ + + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Flash_DeviceID_1_0 { + PP_Resource (*Create)(PP_Instance instance); + /** + * Asynchronously computes the device ID. When available, it will place the + * string in |*id| and will call the completion callback. On failure the + * given var will be PP_VARTYPE_UNDEFINED. + */ + int32_t (*GetDeviceID)(PP_Resource device_id, + struct PP_Var* id, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Flash_DeviceID_1_0 PPB_Flash_DeviceID; +/** + * @} + */ + +#endif /* PPAPI_C_PRIVATE_PPB_FLASH_DEVICE_ID_H_ */ + -- cgit v1.1