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/host/resource_message_handler.cc

Issue 11510008: Refactor 4 PPB_Flash functions to the new PPAPI resource model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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
« no previous file with comments | « ppapi/host/ppapi_host.cc ('k') | ppapi/proxy/flash_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/host/resource_message_handler.cc
diff --git a/ppapi/host/resource_message_handler.cc b/ppapi/host/resource_message_handler.cc
index 9442c1564a21022b29feff22e961bc4aecb7f94d..603d5e2538267b6e6a8b3e6599ace97cdc596626 100644
--- a/ppapi/host/resource_message_handler.cc
+++ b/ppapi/host/resource_message_handler.cc
@@ -22,6 +22,11 @@ void ResourceMessageHandler::RunMessageHandlerAndReply(
const IPC::Message& msg,
HostMessageContext* context) {
ReplyMessageContext reply_context = context->MakeReplyMessageContext();
+ // CAUTION: Handling the message may cause the destruction of this object.
+ // The message handler should ensure that if there is a chance that the
+ // object will be destroyed, PP_OK_COMPLETIONPENDING is returned as the
+ // result of the message handler. Otherwise the code below will attempt to
+ // send a reply message on a destroyed object.
reply_context.params.set_result(OnResourceMessageReceived(msg, context));
// Sanity check the resource handler. Note if the result was
« no previous file with comments | « ppapi/host/ppapi_host.cc ('k') | ppapi/proxy/flash_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698