From a37ce18488adcdbf4d94e67e9685bd6084f238f6 Mon Sep 17 00:00:00 2001 From: David Parks Date: Tue, 10 Jan 2017 17:47:25 -0800 Subject: [PATCH] Bug 1306698 - Make sure that async changes to the plugin render mode do not cause AsyncShowPluginFrame to run when doing direct drawing. r=dvander --- dom/plugins/ipc/PluginInstanceChild.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index d1accce45cc5..9e0fa93db6c8 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -4078,6 +4078,13 @@ PluginInstanceChild::InvalidateRectDelayed(void) } mCurrentInvalidateTask = nullptr; + + // When this method is run asynchronously, we can end up switching to + // direct drawing before while we wait to run. In that case, bail. + if (IsUsingDirectDrawing()) { + return; + } + if (mAccumulatedInvalidRect.IsEmpty()) { return; }