summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-15 05:08:38 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-15 05:08:38 +0000
commitb7631cc577c480fa04d0e7f1d4d1b9ffc60b2cdc (patch)
tree7653d8ec53c9f154be07bc7240ad54d0f0f682e6 /ppapi
parenta78f03cf0fb7e2053099bcc4b73d558c9d653ed1 (diff)
downloadchromium_src-b7631cc577c480fa04d0e7f1d4d1b9ffc60b2cdc.zip
chromium_src-b7631cc577c480fa04d0e7f1d4d1b9ffc60b2cdc.tar.gz
chromium_src-b7631cc577c480fa04d0e7f1d4d1b9ffc60b2cdc.tar.bz2
Convert the async device ID getter to a chrome resource host
Review URL: https://codereview.chromium.org/10909138 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156989 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/host/host_message_context.cc3
-rw-r--r--ppapi/host/host_message_context.h2
-rw-r--r--ppapi/host/ppapi_host.cc16
-rw-r--r--ppapi/host/ppapi_host.h24
-rw-r--r--ppapi/ppapi_proxy.gypi6
-rw-r--r--ppapi/proxy/flash_device_id_resource.cc67
-rw-r--r--ppapi/proxy/flash_device_id_resource.h51
-rw-r--r--ppapi/proxy/interface_list.cc1
-rw-r--r--ppapi/proxy/ppapi_messages.h6
-rw-r--r--ppapi/proxy/ppb_flash_device_id_proxy.cc126
-rw-r--r--ppapi/proxy/ppb_flash_device_id_proxy.h41
-rw-r--r--ppapi/proxy/resource_creation_proxy.cc4
-rw-r--r--ppapi/shared_impl/ppapi_permissions.h2
-rw-r--r--ppapi/thunk/interfaces_ppb_private_flash.h3
-rw-r--r--ppapi/thunk/ppb_flash_device_id_api.h8
-rw-r--r--ppapi/thunk/ppb_flash_device_id_thunk.cc2
16 files changed, 169 insertions, 193 deletions
diff --git a/ppapi/host/host_message_context.cc b/ppapi/host/host_message_context.cc
index 5c1c0d1..ed785bc 100644
--- a/ppapi/host/host_message_context.cc
+++ b/ppapi/host/host_message_context.cc
@@ -15,7 +15,8 @@ HostMessageContext::HostMessageContext(
HostMessageContext::~HostMessageContext() {
}
-ppapi::proxy::ResourceMessageReplyParams HostMessageContext::MakeReplyParams() {
+ppapi::proxy::ResourceMessageReplyParams
+HostMessageContext::MakeReplyParams() const {
return ppapi::proxy::ResourceMessageReplyParams(params.pp_resource(),
params.sequence());
}
diff --git a/ppapi/host/host_message_context.h b/ppapi/host/host_message_context.h
index 6708261..d0958ab 100644
--- a/ppapi/host/host_message_context.h
+++ b/ppapi/host/host_message_context.h
@@ -21,7 +21,7 @@ struct PPAPI_HOST_EXPORT HostMessageContext {
// Returns a "reply params" struct with the same resource and sequence number
// as this request.
- ppapi::proxy::ResourceMessageReplyParams MakeReplyParams();
+ ppapi::proxy::ResourceMessageReplyParams MakeReplyParams() const;
// The original call parameters passed to the resource message call.
const ppapi::proxy::ResourceMessageCallParams& params;
diff --git a/ppapi/host/ppapi_host.cc b/ppapi/host/ppapi_host.cc
index 247c781..0ec37b6 100644
--- a/ppapi/host/ppapi_host.cc
+++ b/ppapi/host/ppapi_host.cc
@@ -26,10 +26,8 @@ const size_t kMaxResourcesPerPlugin = 1 << 14;
} // namespace
PpapiHost::PpapiHost(IPC::Sender* sender,
- HostFactory* host_factory,
const PpapiPermissions& perms)
: sender_(sender),
- host_factory_(host_factory),
permissions_(perms) {
}
@@ -73,6 +71,9 @@ void PpapiHost::SendReply(const proxy::ResourceMessageReplyParams& params,
Send(new PpapiPluginMsg_ResourceReply(params, msg));
}
+void PpapiHost::AddHostFactoryFilter(scoped_ptr<HostFactory> filter) {
+ host_factory_filters_.push_back(filter.release());
+}
void PpapiHost::AddInstanceMessageFilter(
scoped_ptr<InstanceMessageFilter> filter) {
@@ -121,8 +122,15 @@ void PpapiHost::OnHostMsgResourceCreated(
if (resources_.size() >= kMaxResourcesPerPlugin)
return;
- scoped_ptr<ResourceHost> resource_host(
- host_factory_->CreateResourceHost(this, params, instance, nested_msg));
+ // Run through all filters until one grabs this message.
+ scoped_ptr<ResourceHost> resource_host;
+ DCHECK(!host_factory_filters_.empty()); // Caller forgot to add a factory.
+ for (size_t i = 0; i < host_factory_filters_.size(); i++) {
+ resource_host = host_factory_filters_[i]->CreateResourceHost(
+ this, params, instance, nested_msg).Pass();
+ if (resource_host.get())
+ break;
+ }
if (!resource_host.get()) {
NOTREACHED();
return;
diff --git a/ppapi/host/ppapi_host.h b/ppapi/host/ppapi_host.h
index 3f3605c5..748d47a 100644
--- a/ppapi/host/ppapi_host.h
+++ b/ppapi/host/ppapi_host.h
@@ -37,12 +37,11 @@ class ResourceHost;
// corresponding replies.
class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
public:
- // The sender is the channel to the plugin for outgoing messages. The factory
- // will be used to receive resource creation messages from the plugin. Both
- // pointers are owned by the caller and must outlive this class.
- PpapiHost(IPC::Sender* sender,
- HostFactory* host_factory,
- const PpapiPermissions& perms);
+ // The sender is the channel to the plugin for outgoing messages.
+ // Normally the creator will add filters for resource creation messages
+ // (AddHostFactoryFilter) and instance messages (AddInstanceMessageFilter)
+ // after construction.
+ PpapiHost(IPC::Sender* sender, const PpapiPermissions& perms);
virtual ~PpapiHost();
const PpapiPermissions& permissions() const { return permissions_; }
@@ -57,6 +56,10 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
void SendReply(const proxy::ResourceMessageReplyParams& params,
const IPC::Message& msg);
+ // Adds the given host factory filter to the host. The PpapiHost will take
+ // ownership of the pointer.
+ void AddHostFactoryFilter(scoped_ptr<HostFactory> filter);
+
// Adds the given message filter to the host. The PpapiHost will take
// ownership of the pointer.
void AddInstanceMessageFilter(scoped_ptr<InstanceMessageFilter> filter);
@@ -78,11 +81,14 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
// Non-owning pointer.
IPC::Sender* sender_;
- // Non-owning pointer.
- HostFactory* host_factory_;
-
PpapiPermissions permissions_;
+ // Filters for resource creation messages. Note that since we don't support
+ // deleting these dynamically we don't need to worry about modifications
+ // during iteration. If we add that capability, this should be replaced with
+ // an ObserverList.
+ ScopedVector<HostFactory> host_factory_filters_;
+
// Filters for instance messages. Note that since we don't support deleting
// these dynamically we don't need to worry about modifications during
// iteration. If we add that capability, this should be replaced with an
diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi
index e737aa5..a802f87 100644
--- a/ppapi/ppapi_proxy.gypi
+++ b/ppapi/ppapi_proxy.gypi
@@ -27,6 +27,8 @@
'proxy/enter_proxy.h',
'proxy/file_chooser_resource.cc',
'proxy/file_chooser_resource.h',
+ 'proxy/flash_device_id_resource.cc',
+ 'proxy/flash_device_id_resource.h',
'proxy/gamepad_resource.cc',
'proxy/gamepad_resource.h',
'proxy/host_dispatcher.cc',
@@ -72,8 +74,6 @@
'proxy/ppb_file_ref_proxy.h',
'proxy/ppb_file_system_proxy.cc',
'proxy/ppb_file_system_proxy.h',
- 'proxy/ppb_flash_device_id_proxy.cc',
- 'proxy/ppb_flash_device_id_proxy.h',
'proxy/ppb_flash_proxy.cc',
'proxy/ppb_flash_proxy.h',
'proxy/ppb_flash_menu_proxy.cc',
@@ -165,11 +165,11 @@
['>(nacl_untrusted_build)==1', {
'sources!': [
'proxy/broker_dispatcher.cc',
+ 'proxy/flash_device_id_resource.cc',
'proxy/ppb_audio_input_proxy.cc',
'proxy/ppb_broker_proxy.cc',
'proxy/ppb_buffer_proxy.cc',
'proxy/ppb_file_chooser_proxy.cc',
- 'proxy/ppb_flash_device_id_proxy.cc',
'proxy/ppb_flash_proxy.cc',
'proxy/ppb_flash_menu_proxy.cc',
'proxy/ppb_flash_message_loop_proxy.cc',
diff --git a/ppapi/proxy/flash_device_id_resource.cc b/ppapi/proxy/flash_device_id_resource.cc
new file mode 100644
index 0000000..39ff63b
--- /dev/null
+++ b/ppapi/proxy/flash_device_id_resource.cc
@@ -0,0 +1,67 @@
+// 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/proxy/flash_device_id_resource.h"
+
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/proxy/dispatch_reply_message.h"
+#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/var.h"
+
+namespace ppapi {
+namespace proxy {
+
+FlashDeviceIDResource::FlashDeviceIDResource(Connection connection,
+ PP_Instance instance)
+ : PluginResource(connection, instance),
+ dest_(NULL) {
+ SendCreateToBrowser(PpapiHostMsg_FlashDeviceID_Create());
+}
+
+FlashDeviceIDResource::~FlashDeviceIDResource() {
+}
+
+thunk::PPB_Flash_DeviceID_API*
+FlashDeviceIDResource::AsPPB_Flash_DeviceID_API() {
+ return this;
+}
+
+int32_t FlashDeviceIDResource::GetDeviceID(
+ PP_Var* id,
+ scoped_refptr<TrackedCallback> callback) {
+ if (TrackedCallback::IsPending(callback_))
+ return PP_ERROR_INPROGRESS;
+ if (!id)
+ return PP_ERROR_BADARGUMENT;
+
+ dest_ = id;
+ callback_ = callback;
+
+ CallBrowser(PpapiHostMsg_FlashDeviceID_GetDeviceID());
+ return PP_OK_COMPLETIONPENDING;
+}
+
+void FlashDeviceIDResource::OnReplyReceived(
+ const ResourceMessageReplyParams& params,
+ const IPC::Message& msg) {
+ IPC_BEGIN_MESSAGE_MAP(FlashDeviceIDResource, msg)
+ PPAPI_DISPATCH_RESOURCE_REPLY(
+ PpapiPluginMsg_FlashDeviceID_GetDeviceIDReply,
+ OnPluginMsgGetDeviceIDReply)
+ IPC_END_MESSAGE_MAP()
+}
+
+void FlashDeviceIDResource::OnPluginMsgGetDeviceIDReply(
+ const ResourceMessageReplyParams& params,
+ const std::string& id) {
+ if (params.result() == PP_OK)
+ *dest_ = StringVar::StringToPPVar(id);
+ else
+ *dest_ = PP_MakeUndefined();
+ dest_ = NULL;
+ TrackedCallback::ClearAndRun(&callback_, params.result());
+}
+
+} // namespace proxy
+} // namespace ppapi
diff --git a/ppapi/proxy/flash_device_id_resource.h b/ppapi/proxy/flash_device_id_resource.h
new file mode 100644
index 0000000..b563c80
--- /dev/null
+++ b/ppapi/proxy/flash_device_id_resource.h
@@ -0,0 +1,51 @@
+// 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.
+
+#ifndef PPAPI_PROXY_FLASH_DEVICE_ID_RESOURCE_H_
+#define PPAPI_PROXY_FLASH_DEVICE_ID_RESOURCE_H_
+
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/proxy/ppapi_proxy_export.h"
+#include "ppapi/shared_impl/tracked_callback.h"
+#include "ppapi/thunk/ppb_flash_device_id_api.h"
+
+namespace ppapi {
+namespace proxy {
+
+class FlashDeviceIDResource
+ : public PluginResource,
+ public thunk::PPB_Flash_DeviceID_API {
+ public:
+ FlashDeviceIDResource(Connection connection,
+ PP_Instance instance);
+ virtual ~FlashDeviceIDResource();
+
+ // Resource override.
+ virtual thunk::PPB_Flash_DeviceID_API* AsPPB_Flash_DeviceID_API() OVERRIDE;
+
+ // PPB_Flash_DeviceID_API implementation.
+ virtual int32_t GetDeviceID(PP_Var* id,
+ scoped_refptr<TrackedCallback> callback) OVERRIDE;
+
+ private:
+ // PluginResource override;
+ virtual void OnReplyReceived(const ResourceMessageReplyParams& params,
+ const IPC::Message& msg);
+
+ // IPC message handler.
+ void OnPluginMsgGetDeviceIDReply(const ResourceMessageReplyParams& params,
+ const std::string& id);
+
+ // Non-null when a callback is pending.
+ PP_Var* dest_;
+
+ scoped_refptr<TrackedCallback> callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(FlashDeviceIDResource);
+};
+
+} // namespace proxy
+} // namespace ppapi
+
+#endif // PPAPI_PROXY_FLASH_DEVICE_ID_RESOURCE_H_
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 129901c..d77c1cb 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -84,7 +84,6 @@
#include "ppapi/proxy/ppb_file_io_proxy.h"
#include "ppapi/proxy/ppb_file_ref_proxy.h"
#include "ppapi/proxy/ppb_file_system_proxy.h"
-#include "ppapi/proxy/ppb_flash_device_id_proxy.h"
#include "ppapi/proxy/ppb_flash_menu_proxy.h"
#include "ppapi/proxy/ppb_flash_message_loop_proxy.h"
#include "ppapi/proxy/ppb_flash_proxy.h"
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index cfdc984..2478b0f 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1549,6 +1549,12 @@ IPC_MESSAGE_CONTROL4(PpapiHostMsg_FileChooser_Show,
IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FileChooser_ShowReply,
std::vector<ppapi::PPB_FileRef_CreateInfo> /* files */)
+// Flash device ID.
+IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDeviceID_Create)
+IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDeviceID_GetDeviceID)
+IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDeviceID_GetDeviceIDReply,
+ std::string /* id */)
+
// Gamepad.
IPC_MESSAGE_CONTROL0(PpapiHostMsg_Gamepad_Create)
diff --git a/ppapi/proxy/ppb_flash_device_id_proxy.cc b/ppapi/proxy/ppb_flash_device_id_proxy.cc
deleted file mode 100644
index bb66b33..0000000
--- a/ppapi/proxy/ppb_flash_device_id_proxy.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-// 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/proxy/ppb_flash_device_id_proxy.h"
-
-#include "base/compiler_specific.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/proxy/plugin_dispatcher.h"
-#include "ppapi/proxy/plugin_globals.h"
-#include "ppapi/proxy/plugin_proxy_delegate.h"
-#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/shared_impl/resource.h"
-#include "ppapi/shared_impl/tracked_callback.h"
-#include "ppapi/shared_impl/var.h"
-#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/ppb_flash_device_id_api.h"
-
-using ppapi::thunk::PPB_Flash_DeviceID_API;
-
-namespace ppapi {
-namespace proxy {
-
-namespace {
-
-class DeviceID : public Resource, public PPB_Flash_DeviceID_API {
- public:
- DeviceID(PP_Instance instance);
- virtual ~DeviceID();
-
- // Resource overrides.
- virtual PPB_Flash_DeviceID_API* AsPPB_Flash_DeviceID_API() OVERRIDE;
-
- // PPB_Flash_DeviceID_API implementation.
- virtual int32_t GetDeviceID(PP_Var* id,
- const PP_CompletionCallback& callback) OVERRIDE;
-
- void OnReply(int32_t result, const std::string& id);
-
- private:
- // Non-null when a callback is pending.
- PP_Var* dest_;
-
- scoped_refptr<TrackedCallback> callback_;
-
- DISALLOW_COPY_AND_ASSIGN(DeviceID);
-};
-
-DeviceID::DeviceID(PP_Instance instance)
- : Resource(OBJECT_IS_PROXY, instance),
- dest_(NULL) {
-}
-
-DeviceID::~DeviceID() {
-}
-
-PPB_Flash_DeviceID_API* DeviceID::AsPPB_Flash_DeviceID_API() {
- return this;
-}
-
-int32_t DeviceID::GetDeviceID(PP_Var* id,
- const PP_CompletionCallback& callback) {
- if (TrackedCallback::IsPending(callback_))
- return PP_ERROR_INPROGRESS;
- if (!id)
- return PP_ERROR_BADARGUMENT;
-
- callback_ = new TrackedCallback(this, callback);
- dest_ = id;
-
- PluginDispatcher* dispatcher =
- PluginDispatcher::GetForInstance(pp_instance());
-
- PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
- new PpapiHostMsg_PPBFlashDeviceID_Get(
- API_ID_PPB_FLASH_DEVICE_ID, dispatcher->plugin_dispatcher_id(),
- pp_resource()));
- return PP_OK_COMPLETIONPENDING;
-}
-
-void DeviceID::OnReply(int32_t result, const std::string& id) {
- if (result == PP_OK)
- *dest_ = StringVar::StringToPPVar(id);
- else
- *dest_ = PP_MakeUndefined();
- dest_ = NULL;
- TrackedCallback::ClearAndRun(&callback_, result);
-}
-
-} // namespace
-
-PPB_Flash_DeviceID_Proxy::PPB_Flash_DeviceID_Proxy(Dispatcher* dispatcher)
- : InterfaceProxy(dispatcher) {
-}
-
-PPB_Flash_DeviceID_Proxy::~PPB_Flash_DeviceID_Proxy() {
-}
-
-// static
-PP_Resource PPB_Flash_DeviceID_Proxy::CreateProxyResource(
- PP_Instance instance) {
- return (new DeviceID(instance))->GetReference();
-}
-
-bool PPB_Flash_DeviceID_Proxy::OnMessageReceived(const IPC::Message& msg) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(PPB_Flash_DeviceID_Proxy, msg)
- IPC_MESSAGE_HANDLER(PpapiMsg_PPBFlashDeviceID_GetReply,
- OnPluginMsgGetReply)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void PPB_Flash_DeviceID_Proxy::OnPluginMsgGetReply(int32 routing_id,
- PP_Resource resource,
- int32 result,
- const std::string& id) {
- thunk::EnterResourceNoLock<PPB_Flash_DeviceID_API> enter(resource, false);
- if (enter.failed())
- return; // Resource destroyed.
- static_cast<DeviceID*>(enter.object())->OnReply(result, id);
-}
-
-} // namespace proxy
-} // namespace ppapi
diff --git a/ppapi/proxy/ppb_flash_device_id_proxy.h b/ppapi/proxy/ppb_flash_device_id_proxy.h
deleted file mode 100644
index f379873..0000000
--- a/ppapi/proxy/ppb_flash_device_id_proxy.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// 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.
-
-#ifndef PPAPI_PROXY_PPB_FLASH_DEVICE_ID_PROXY_H_
-#define PPAPI_PROXY_PPB_FLASH_DEVICE_ID_PROXY_H_
-
-#include <string>
-
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/proxy/interface_proxy.h"
-
-namespace ppapi {
-namespace proxy {
-
-class PPB_Flash_DeviceID_Proxy : public InterfaceProxy {
- public:
- PPB_Flash_DeviceID_Proxy(Dispatcher* dispatcher);
- virtual ~PPB_Flash_DeviceID_Proxy();
-
- static PP_Resource CreateProxyResource(PP_Instance instance);
-
- // InterfaceProxy implementation.
- virtual bool OnMessageReceived(const IPC::Message& msg);
-
- static const ApiID kApiID = API_ID_PPB_FLASH_DEVICE_ID;
-
- private:
- void OnPluginMsgGetReply(int32 routing_id,
- PP_Resource resource,
- int32 result,
- const std::string& id);
-
- DISALLOW_COPY_AND_ASSIGN(PPB_Flash_DeviceID_Proxy);
-};
-
-} // namespace proxy
-} // namespace ppapi
-
-#endif // PPAPI_PROXY_PPB_FLASH_DEVICE_ID_PROXY_H_
-
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
index f24f86a..0981b82 100644
--- a/ppapi/proxy/resource_creation_proxy.cc
+++ b/ppapi/proxy/resource_creation_proxy.cc
@@ -9,6 +9,7 @@
#include "ppapi/c/trusted/ppb_image_data_trusted.h"
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/file_chooser_resource.h"
+#include "ppapi/proxy/flash_device_id_resource.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/plugin_proxy_delegate.h"
@@ -21,7 +22,6 @@
#include "ppapi/proxy/ppb_file_io_proxy.h"
#include "ppapi/proxy/ppb_file_ref_proxy.h"
#include "ppapi/proxy/ppb_file_system_proxy.h"
-#include "ppapi/proxy/ppb_flash_device_id_proxy.h"
#include "ppapi/proxy/ppb_flash_menu_proxy.h"
#include "ppapi/proxy/ppb_flash_message_loop_proxy.h"
#include "ppapi/proxy/ppb_graphics_2d_proxy.h"
@@ -303,7 +303,7 @@ PP_Resource ResourceCreationProxy::CreateFileChooser(
}
PP_Resource ResourceCreationProxy::CreateFlashDeviceID(PP_Instance instance) {
- return PPB_Flash_DeviceID_Proxy::CreateProxyResource(instance);
+ return (new FlashDeviceIDResource(GetConnection(), instance))->GetReference();
}
PP_Resource ResourceCreationProxy::CreateFlashMenu(
diff --git a/ppapi/shared_impl/ppapi_permissions.h b/ppapi/shared_impl/ppapi_permissions.h
index 4b1c6a6..8456fb7 100644
--- a/ppapi/shared_impl/ppapi_permissions.h
+++ b/ppapi/shared_impl/ppapi_permissions.h
@@ -19,7 +19,7 @@ enum Permission {
// Allows ability to bypass user-gesture checks for showing things like
// file select dialogs.
- PERMISSION_BYPASS_USER_GESTURE = 1 << 3
+ PERMISSION_BYPASS_USER_GESTURE = 1 << 3,
// NOTE: If you add stuff be sure to update AllPermissions().
};
diff --git a/ppapi/thunk/interfaces_ppb_private_flash.h b/ppapi/thunk/interfaces_ppb_private_flash.h
index 7226020..8ec049a 100644
--- a/ppapi/thunk/interfaces_ppb_private_flash.h
+++ b/ppapi/thunk/interfaces_ppb_private_flash.h
@@ -46,8 +46,7 @@ PROXIED_IFACE(PPB_Flash,
PPB_FLASH_FILE_FILEREF_INTERFACE,
PPB_Flash_File_FileRef)
-PROXIED_API(PPB_Flash_DeviceID)
-PROXIED_IFACE(PPB_Flash_DeviceID,
+PROXIED_IFACE(NoAPIName,
PPB_FLASH_DEVICEID_INTERFACE_1_0,
PPB_Flash_DeviceID_1_0)
diff --git a/ppapi/thunk/ppb_flash_device_id_api.h b/ppapi/thunk/ppb_flash_device_id_api.h
index ae31abd..cbd1bf5 100644
--- a/ppapi/thunk/ppb_flash_device_id_api.h
+++ b/ppapi/thunk/ppb_flash_device_id_api.h
@@ -2,7 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/memory/ref_counted.h"
+#include "ppapi/thunk/ppapi_thunk_export.h"
+
namespace ppapi {
+
+class TrackedCallback;
+
namespace thunk {
class PPAPI_THUNK_EXPORT PPB_Flash_DeviceID_API {
@@ -10,7 +16,7 @@ class PPAPI_THUNK_EXPORT PPB_Flash_DeviceID_API {
virtual ~PPB_Flash_DeviceID_API() {}
virtual int32_t GetDeviceID(PP_Var* id,
- const PP_CompletionCallback& callback) = 0;
+ scoped_refptr<TrackedCallback> callback) = 0;
};
} // namespace thunk
diff --git a/ppapi/thunk/ppb_flash_device_id_thunk.cc b/ppapi/thunk/ppb_flash_device_id_thunk.cc
index 9275648..498df75 100644
--- a/ppapi/thunk/ppb_flash_device_id_thunk.cc
+++ b/ppapi/thunk/ppb_flash_device_id_thunk.cc
@@ -26,7 +26,7 @@ int32_t GetDeviceID(PP_Resource resource,
EnterResource<PPB_Flash_DeviceID_API> enter(resource, callback, true);
if (enter.failed())
return enter.retval();
- return enter.SetResult(enter.object()->GetDeviceID(id, callback));
+ return enter.SetResult(enter.object()->GetDeviceID(id, enter.callback()));
}
const PPB_Flash_DeviceID g_ppb_flash_deviceid_thunk = {