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

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: stop using HashPassword as it has legacy behavior. 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..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 = "";
brettw 2012/05/03 20:34:21 id->clear()
Will Drewry 2012/05/03 21:58:49 Done.
+ if (enter.succeeded()) {
+ PP_Var id_var = enter.functions()->GetFlashAPI()->GetDeviceID(instance);
brettw 2012/05/03 20:34:21 This leaks the string. You should probably change
Will Drewry 2012/05/03 21:58:49 Done - I think :) Initial tests all look good, but
+ StringVar* id_str = StringVar::FromPPVar(id_var);
+ if (id_str) {
brettw 2012/05/03 20:34:21 No {} here.
Will Drewry 2012/05/03 21:58:49 Done.
+ *id = id_str->value();
+ }
+ }
+}
+
} // namespace proxy
} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698