Ignore messages sent from resources after a PluginDispatcher has been destroyed

The PluginDispatcher can be freed but resources are leaked and can still attempt
to send messages. We ignore these messages now.

Bug: 725033
Change-Id: Ifb580070cf7e6eb25b5d5ec9d4dd6691c22f5489
Reviewed-on: https://chromium-review.googlesource.com/583416
Reviewed-by: Antoine Labour <[email protected]>
Commit-Queue: Raymes Khoury <[email protected]>
Cr-Commit-Position: refs/heads/master@{#489580}
diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc
index f228a5e..177012dd 100644
--- a/ppapi/proxy/plugin_resource.cc
+++ b/ppapi/proxy/plugin_resource.cc
@@ -26,11 +26,11 @@
 
 PluginResource::~PluginResource() {
   if (sent_create_to_browser_) {
-    connection_.browser_sender->Send(
+    connection_.browser_sender()->Send(
         new PpapiHostMsg_ResourceDestroyed(pp_resource()));
   }
   if (sent_create_to_renderer_) {
-    connection_.renderer_sender->Send(
+    connection_.GetRendererSender()->Send(
         new PpapiHostMsg_ResourceDestroyed(pp_resource()));
   }
 
@@ -124,11 +124,9 @@
   // For in-process plugins, we need to send the routing ID with the request.
   // The browser then uses that routing ID when sending the reply so it will be
   // routed back to the correct RenderFrameImpl.
-  if (dest == BROWSER && connection_.in_process) {
+  if (dest == BROWSER && connection_.in_process()) {
     return GetSender(dest)->Send(new PpapiHostMsg_InProcessResourceCall(
-        connection_.browser_sender_routing_id,
-        call_params,
-        nested_msg));
+        connection_.browser_sender_routing_id(), call_params, nested_msg));
   } else {
     return GetSender(dest)->Send(
         new PpapiHostMsg_ResourceCall(call_params, nested_msg));