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

Unified Diff: ppapi/host/ppapi_host.cc

Issue 11410029: Added a ResourceMessageFilter for handling resource messages on another thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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/host/ppapi_host.cc
diff --git a/ppapi/host/ppapi_host.cc b/ppapi/host/ppapi_host.cc
index 44d3ee5d390149618a2fb105e6cd3b213aba3f11..05d75c02d762a106980b3c8f4a8f885c3e0f52d6 100644
--- a/ppapi/host/ppapi_host.cc
+++ b/ppapi/host/ppapi_host.cc
@@ -118,40 +118,14 @@ void PpapiHost::HandleResourceCall(
const proxy::ResourceMessageCallParams& params,
const IPC::Message& nested_msg,
HostMessageContext* context) {
- ReplyMessageContext reply_context = context->MakeReplyMessageContext();
-
ResourceHost* resource_host = GetResourceHost(params.pp_resource());
if (resource_host) {
- reply_context.params.set_result(
- resource_host->OnResourceMessageReceived(nested_msg, context));
-
- // Sanity check the resource handler. Note if the result was
- // "completion pending" the resource host may have already sent the reply.
- if (reply_context.params.result() == PP_OK_COMPLETIONPENDING) {
- // Message handler should have only returned a pending result if a
- // response will be sent to the plugin.
- DCHECK(params.has_callback());
-
- // Message handler should not have written a message to be returned if
- // completion is pending.
- DCHECK(context->reply_msg.type() == 0);
- } else if (!params.has_callback()) {
- // When no response is required, the message handler should not have
- // written a message to be returned.
- DCHECK(context->reply_msg.type() == 0);
-
- // If there is no callback and the result of running the message handler
- // was not PP_OK the client won't find out.
- DLOG_IF(WARNING, reply_context.params.result() != PP_OK)
- << "'Post' message handler failed to complete successfully.";
- }
+ resource_host->HandleMessage(nested_msg, context);
} else {
+ ReplyMessageContext reply_context = context->MakeReplyMessageContext();
reply_context.params.set_result(PP_ERROR_BADRESOURCE);
- }
-
- if (params.has_callback() &&
- reply_context.params.result() != PP_OK_COMPLETIONPENDING)
SendReply(reply_context, context->reply_msg);
yzshen1 2012/11/13 21:51:48 Maybe the message doesn't expect a reply.
raymes 2012/11/16 18:56:35 Done.
+ }
}
void PpapiHost::OnHostMsgResourceCreated(

Powered by Google App Engine
This is Rietveld 408576698