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

Unified Diff: content/browser/renderer_host/pepper_message_filter.cc

Issue 10535062: Add an asynchronous version of the Flash DeviceID API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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: content/browser/renderer_host/pepper_message_filter.cc
diff --git a/content/browser/renderer_host/pepper_message_filter.cc b/content/browser/renderer_host/pepper_message_filter.cc
index c271e0b1c5ff2f0e6d497cf064c0d5a17352059c..e4a97f3f934f9d1d9c8bce1255a0a0daa05cb115 100644
--- a/content/browser/renderer_host/pepper_message_filter.cc
+++ b/content/browser/renderer_host/pepper_message_filter.cc
@@ -107,7 +107,8 @@ void PepperMessageFilter::OverrideThreadForMessage(
message.type() == PpapiHostMsg_PPBTCPServerSocket_Listen::ID ||
message.type() == PpapiHostMsg_PPBHostResolver_Resolve::ID) {
*thread = BrowserThread::UI;
- } else if (message.type() == PepperMsg_GetDeviceID::ID) {
+ } else if (message.type() == PepperMsg_GetDeviceID::ID ||
+ message.type() == PpapiHostMsg_PPBFlashDeviceID_Get::ID) {
*thread = BrowserThread::FILE;
}
}
@@ -163,6 +164,7 @@ bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg,
// Flash messages.
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_UpdateActivity, OnUpdateActivity)
IPC_MESSAGE_HANDLER(PepperMsg_GetDeviceID, OnGetDeviceID)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashDeviceID_Get, OnGetDeviceIDAsync)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
@@ -684,6 +686,17 @@ void PepperMessageFilter::OnGetDeviceID(std::string* id) {
id->assign(id_buf, kDRMIdentifierSize);
}
+void PepperMessageFilter::OnGetDeviceIDAsync(int32_t routing_id,
+ PP_Resource resource) {
+ std::string result;
+ OnGetDeviceID(&result);
+ Send(new PpapiMsg_PPBFlashDeviceID_GetReply(ppapi::API_ID_PPB_FLASH_DEVICE_ID,
+ routing_id, resource,
+ result.empty() ? PP_ERROR_FAILED
+ : PP_OK,
+ result));
+}
+
void PepperMessageFilter::GetFontFamiliesComplete(
IPC::Message* reply_msg,
scoped_ptr<base::ListValue> result) {

Powered by Google App Engine
This is Rietveld 408576698