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

Unified Diff: trunk/src/content/renderer/pepper/pepper_in_process_router.cc

Issue 321933002: Revert 274770 "Ensure that in-process plugins can't destroy them..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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
« no previous file with comments | « no previous file | trunk/src/content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/content/renderer/pepper/pepper_in_process_router.cc
===================================================================
--- trunk/src/content/renderer/pepper/pepper_in_process_router.cc (revision 275860)
+++ trunk/src/content/renderer/pepper/pepper_in_process_router.cc (working copy)
@@ -103,48 +103,20 @@
bool PepperInProcessRouter::SendToHost(IPC::Message* msg) {
scoped_ptr<IPC::Message> message(msg);
- // Unpack the message so we can peek at its nested type.
- uint32 call_type = 0;
- if (message->type() == PpapiHostMsg_ResourceCall::ID) {
- ppapi::proxy::ResourceMessageCallParams call_params;
- IPC::Message nested_msg;
- if (!UnpackMessage<PpapiHostMsg_ResourceCall>(*msg, &call_params,
- &nested_msg)) {
- NOTREACHED();
- return false;
- }
- call_type = nested_msg.type();
- // Repack the message.
- message.reset(new PpapiHostMsg_ResourceCall(call_params, nested_msg));
- }
-
if (!message->is_sync()) {
+ // If this is a resource destroyed message, post a task to dispatch it.
+ // Dispatching it synchronously can cause the host to re-enter the proxy
+ // code while we're still in the resource destructor, leading to a crash.
+ // http://crbug.com/276368.
+ // This won't cause message reordering problems because the resource
+ // destroyed message is always the last one sent for a resource.
if (message->type() == PpapiHostMsg_ResourceDestroyed::ID) {
- // If this is a resource destroyed message, post a task to dispatch it.
- // Dispatching it synchronously can cause the host to re-enter the proxy
- // code while we're still in the resource destructor, leading to a crash.
- // http://crbug.com/276368.
- // This won't cause message reordering problems because the resource
- // destroyed message is always the last one sent for a resource.
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&PepperInProcessRouter::DispatchHostMsg,
weak_factory_.GetWeakPtr(),
base::Owned(message.release())));
return true;
- } else if (call_type == PpapiHostMsg_URLLoader_Close::ID) {
- // If this is a PpapiHostMsg_URLLoader_Close, it could trigger the
- // destruction of the instance (crbug.com/372548) so post a task to
- // dispatch it as well. Because PpapiHostMsg_ResourceDestroyed messages
- // are also posted above, ordering with respect to those messages will
- // still be correct. Ordering with respect to other messages should not
- // be important.
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&PepperInProcessRouter::DispatchHostMsg,
- weak_factory_.GetWeakPtr(),
- base::Owned(message.release())));
- return true;
} else {
bool result = host_impl_->GetPpapiHost()->OnMessageReceived(*message);
DCHECK(result) << "The message was not handled by the host.";
« no previous file with comments | « no previous file | trunk/src/content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698