Chromium Code Reviews| Index: chrome/browser/renderer_host/pepper/pepper_talk_host.cc |
| diff --git a/chrome/browser/renderer_host/pepper/pepper_talk_host.cc b/chrome/browser/renderer_host/pepper/pepper_talk_host.cc |
| index cdb65a76d2bbf6580203de84852548d873966395..e322920111d390e7ab150a7255ed21de0e69881f 100644 |
| --- a/chrome/browser/renderer_host/pepper/pepper_talk_host.cc |
| +++ b/chrome/browser/renderer_host/pepper/pepper_talk_host.cc |
| @@ -10,6 +10,7 @@ |
| #include "content/public/browser/render_view_host.h" |
| #include "grit/generated_resources.h" |
| #include "ppapi/c/pp_errors.h" |
| +#include "ppapi/host/dispatch_host_message.h" |
| #include "ppapi/host/host_message_context.h" |
| #include "ppapi/host/ppapi_host.h" |
| #include "ppapi/proxy/ppapi_messages.h" |
| @@ -75,9 +76,19 @@ PepperTalkHost::~PepperTalkHost() { |
| int32_t PepperTalkHost::OnResourceMessageReceived( |
| const IPC::Message& msg, |
| ppapi::host::HostMessageContext* context) { |
| - // We only have one message with no parameters. |
| - if (msg.type() != PpapiHostMsg_Talk_GetPermission::ID) |
| - return 0; |
| + IPC_BEGIN_MESSAGE_MAP(PepperTalkHost, msg) |
| + PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Talk_RequestPermission, |
| + OnRequestPermission) |
| + IPC_END_MESSAGE_MAP() |
| + return PP_ERROR_FAILED; |
|
Josh Horwich
2013/06/04 19:48:37
Curious - we used to return 0 here for unknown mes
dcaiafa
2013/06/04 22:38:15
I'm not an expert, but every other host in this di
|
| +} |
| + |
| +int32_t PepperTalkHost::OnRequestPermission( |
| + ppapi::host::HostMessageContext* context, |
| + PP_TalkPermission permission) { |
| + // TODO(dcaiafa): Implement support for other permission types. |
| + if (permission != PP_TALKPERMISSION_SCREENCAST) |
| + return PP_ERROR_BADARGUMENT; |
| int render_process_id = 0; |
| int render_view_id = 0; |
| @@ -96,7 +107,7 @@ int32_t PepperTalkHost::OnResourceMessageReceived( |
| void PepperTalkHost::GotTalkPermission( |
| ppapi::host::ReplyMessageContext reply) { |
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| - host()->SendReply(reply, PpapiPluginMsg_Talk_GetPermissionReply()); |
| + host()->SendReply(reply, PpapiPluginMsg_Talk_RequestPermissionReply()); |
| } |
| } // namespace chrome |