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..cd4365c7f5dbe61d52a5b6a16eccb60805e6ee01 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! |
@@ -549,10 +551,10 @@ 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)); |
- return StringVar::StringToPPVar(id); |
+ ReceiveSerializedVarReturnValue result; |
+ dispatcher()->Send(new PpapiHostMsg_PPBFlash_GetDeviceID( |
+ API_ID_PPB_FLASH, instance, &result)); |
+ return result.Return(dispatcher()); |
} |
int32_t PPB_Flash_Proxy::GetSettingInt(PP_Instance instance, |
@@ -1139,5 +1141,17 @@ void PPB_Flash_Proxy::OnHostMsgQueryFileRef( |
instance, host_resource.host_resource(), info); |
} |
+void PPB_Flash_Proxy::OnHostMsgGetDeviceID(PP_Instance instance, |
+ SerializedVarReturnValue id) { |
+ EnterInstanceNoLock enter(instance); |
+ if (enter.succeeded()) { |
+ id.Return(dispatcher(), |
+ enter.functions()->GetFlashAPI()->GetDeviceID( |
+ instance)); |
+ } else { |
+ id.Return(dispatcher(), PP_MakeUndefined()); |
+ } |
+} |
+ |
} // namespace proxy |
} // namespace ppapi |