summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 20:45:01 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 20:45:01 +0000
commit502ec4dda4411088ac46b55754a027235e4b9217 (patch)
tree97a150aca10c22b5b24060a5194164e636521d40 /ppapi/thunk
parent84734df4b93aa0e7d01313b17ff190022dcca8bf (diff)
downloadchromium_src-502ec4dda4411088ac46b55754a027235e4b9217.zip
chromium_src-502ec4dda4411088ac46b55754a027235e4b9217.tar.gz
chromium_src-502ec4dda4411088ac46b55754a027235e4b9217.tar.bz2
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
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/interfaces_ppb_private_flash.h5
-rw-r--r--ppapi/thunk/ppb_flash_device_id_api.h18
-rw-r--r--ppapi/thunk/ppb_flash_device_id_thunk.cc44
-rw-r--r--ppapi/thunk/resource_creation_api.h1
4 files changed, 68 insertions, 0 deletions
diff --git a/ppapi/thunk/interfaces_ppb_private_flash.h b/ppapi/thunk/interfaces_ppb_private_flash.h
index fa8842a..c0bd0df 100644
--- a/ppapi/thunk/interfaces_ppb_private_flash.h
+++ b/ppapi/thunk/interfaces_ppb_private_flash.h
@@ -40,6 +40,11 @@ PROXIED_IFACE(PPB_Flash,
PPB_FLASH_FILE_FILEREF_INTERFACE,
PPB_Flash_File_FileRef)
+PROXIED_API(PPB_Flash_DeviceID)
+PROXIED_IFACE(PPB_Flash_DeviceID,
+ PPB_FLASH_DEVICEID_INTERFACE_1_0,
+ PPB_Flash_DeviceID_1_0)
+
PROXIED_API(PPB_Flash_Menu)
PROXIED_IFACE(PPB_Flash_Menu,
PPB_FLASH_MENU_INTERFACE_0_2,
diff --git a/ppapi/thunk/ppb_flash_device_id_api.h b/ppapi/thunk/ppb_flash_device_id_api.h
new file mode 100644
index 0000000..ae31abd
--- /dev/null
+++ b/ppapi/thunk/ppb_flash_device_id_api.h
@@ -0,0 +1,18 @@
+// 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.
+
+namespace ppapi {
+namespace thunk {
+
+class PPAPI_THUNK_EXPORT PPB_Flash_DeviceID_API {
+ public:
+ virtual ~PPB_Flash_DeviceID_API() {}
+
+ virtual int32_t GetDeviceID(PP_Var* id,
+ const PP_CompletionCallback& callback) = 0;
+};
+
+} // namespace thunk
+} // namespace ppapi
+
diff --git a/ppapi/thunk/ppb_flash_device_id_thunk.cc b/ppapi/thunk/ppb_flash_device_id_thunk.cc
new file mode 100644
index 0000000..9275648
--- /dev/null
+++ b/ppapi/thunk/ppb_flash_device_id_thunk.cc
@@ -0,0 +1,44 @@
+// 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.
+
+#include "ppapi/c/private/ppb_flash_device_id.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/thunk.h"
+#include "ppapi/thunk/ppb_flash_device_id_api.h"
+#include "ppapi/thunk/resource_creation_api.h"
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+PP_Resource Create(PP_Instance instance) {
+ EnterResourceCreation enter(instance);
+ if (enter.failed())
+ return 0;
+ return enter.functions()->CreateFlashDeviceID(instance);
+}
+
+int32_t GetDeviceID(PP_Resource resource,
+ PP_Var* id,
+ PP_CompletionCallback callback) {
+ EnterResource<PPB_Flash_DeviceID_API> enter(resource, callback, true);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(enter.object()->GetDeviceID(id, callback));
+}
+
+const PPB_Flash_DeviceID g_ppb_flash_deviceid_thunk = {
+ &Create,
+ &GetDeviceID
+};
+
+} // namespace
+
+const PPB_Flash_DeviceID_1_0* GetPPB_Flash_DeviceID_1_0_Thunk() {
+ return &g_ppb_flash_deviceid_thunk;
+}
+
+} // namespace thunk
+} // namespace ppapi
diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h
index 3cd1752..51b179e 100644
--- a/ppapi/thunk/resource_creation_api.h
+++ b/ppapi/thunk/resource_creation_api.h
@@ -115,6 +115,7 @@ class ResourceCreationAPI {
PP_Instance instance,
PP_FileChooserMode_Dev mode,
const char* accept_types) = 0;
+ virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) = 0;
virtual PP_Resource CreateFlashMenu(PP_Instance instance,
const PP_Flash_Menu* menu_data) = 0;
virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0;