Index: content/renderer/browser_plugin/browser_plugin_manager_impl.cc |
diff --git a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc |
index 7eb0b713cddad1428d3132d8b55219293efedfb9..2cc6bd9c485a095862d8e55700bcf6ddcdf34b99 100644 |
--- a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc |
+++ b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc |
@@ -49,6 +49,8 @@ bool BrowserPluginManagerImpl::OnMessageReceived( |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message) |
+ IPC_MESSAGE_HANDLER(BrowserPluginMsg_BuffersSwapped, |
+ OnUnhandledSwap); |
IPC_MESSAGE_HANDLER(BrowserPluginMsg_PluginAtPositionRequest, |
OnPluginAtPositionRequest); |
IPC_MESSAGE_UNHANDLED(handled = false) |
@@ -84,6 +86,26 @@ void BrowserPluginManagerImpl::OnPluginAtPositionRequest( |
local_position)); |
} |
+void BrowserPluginManagerImpl::OnUnhandledSwap(const IPC::Message& message, |
+ int instance_id, |
+ const gfx::Size& size, |
+ std::string mailbox_name, |
+ int gpu_route_id, |
+ int gpu_host_id) { |
+ // After the BrowserPlugin object sends a destroy message to the |
+ // guest, it goes away and is unable to handle messages that |
+ // might still be coming from the guest. |
+ // In this case, we might receive a BuffersSwapped message that |
+ // we need to ACK. |
+ // Issue is tracked in crbug.com/170745. |
+ Send(new BrowserPluginHostMsg_BuffersSwappedACK( |
+ message.routing_id(), |
+ gpu_route_id, |
+ gpu_host_id, |
+ mailbox_name, |
+ 0)); |
+} |
+ |
// static |
bool BrowserPluginManagerImpl::ShouldForwardToBrowserPlugin( |
const IPC::Message& message) { |