Index: ppapi/proxy/ppb_flash_proxy.cc |
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc |
index 842abeb47300b37c0b5045ae506b22f3d6a24e03..4cdb338fd07769da48a6606c783839ba7f5a7008 100644 |
--- a/ppapi/proxy/ppb_flash_proxy.cc |
+++ b/ppapi/proxy/ppb_flash_proxy.cc |
@@ -424,6 +424,8 @@ bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) { |
OnHostMsgOpenFileRef) |
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QueryFileRef, |
OnHostMsgQueryFileRef) |
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetDeviceID, |
+ OnHostMsgGetDeviceID) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
// TODO(brettw) handle bad messages! |
@@ -550,8 +552,8 @@ void PPB_Flash_Proxy::UpdateActivity(PP_Instance instance) { |
PP_Var PPB_Flash_Proxy::GetDeviceID(PP_Instance instance) { |
std::string id; |
- PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( |
- new PpapiHostMsg_PPBFlash_GetDeviceID(API_ID_PPB_FLASH, &id)); |
+ dispatcher()->Send(new PpapiHostMsg_PPBFlash_GetDeviceID( |
+ API_ID_PPB_FLASH, instance, &id)); |
return StringVar::StringToPPVar(id); |
} |
@@ -1139,5 +1141,18 @@ void PPB_Flash_Proxy::OnHostMsgQueryFileRef( |
instance, host_resource.host_resource(), info); |
} |
+void PPB_Flash_Proxy::OnHostMsgGetDeviceID(PP_Instance instance, |
+ std::string* id) { |
+ EnterInstanceNoLock enter(instance); |
+ *id = ""; |
+ if (enter.succeeded()) { |
+ PP_Var id_var = enter.functions()->GetFlashAPI()->GetDeviceID(instance); |
+ StringVar* id_str = StringVar::FromPPVar(id_var); |
+ if (id_str) { |
+ *id = id_str->value(); |
+ } |
+ } |
+} |
+ |
} // namespace proxy |
} // namespace ppapi |