Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: ppapi/proxy/ppb_flash_proxy.cc

Issue 10342013: Generate and connect a Pepper identifier for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup as per brettw; move to serializedreturnvar in the host msg bounce step Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698