From d97bf323b1559e2daa4cab47a228629ef79762c8 Mon Sep 17 00:00:00 2001 From: Ben Turner Date: Fri, 13 Nov 2009 13:19:33 -0800 Subject: [PATCH] Followup to bug 527876 --- dom/plugins/PluginInstanceChild.cpp | 6 ++++-- dom/plugins/PluginInstanceChild.h | 4 +++- dom/plugins/PluginModuleChild.cpp | 7 ++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dom/plugins/PluginInstanceChild.cpp b/dom/plugins/PluginInstanceChild.cpp index 589baf00390..5abe86626db 100644 --- a/dom/plugins/PluginInstanceChild.cpp +++ b/dom/plugins/PluginInstanceChild.cpp @@ -839,10 +839,9 @@ PluginInstanceChild::NPN_NewStream(NPMIMEType aMIMEType, const char* aWindow, return NPERR_NO_ERROR; } -void +bool PluginInstanceChild::InternalInvalidateRect(NPRect* aInvalidRect) { - // Should only be called on windowed plugins! NS_ASSERTION(aInvalidRect, "Null pointer!"); #ifdef OS_WIN @@ -851,4 +850,7 @@ PluginInstanceChild::InternalInvalidateRect(NPRect* aInvalidRect) aInvalidRect->right, aInvalidRect->bottom }; InvalidateRect(mPluginWindowHWND, &rect, FALSE); #endif + + // Windowless plugins must return true! + return false; } diff --git a/dom/plugins/PluginInstanceChild.h b/dom/plugins/PluginInstanceChild.h index 234885658d8..8a6878fdf4e 100644 --- a/dom/plugins/PluginInstanceChild.h +++ b/dom/plugins/PluginInstanceChild.h @@ -165,7 +165,9 @@ public: NPN_NewStream(NPMIMEType aMIMEType, const char* aWindow, NPStream** aStream); - void + // Return true if you want to send the notification to the parent process + // also. + bool InternalInvalidateRect(NPRect* aInvalidRect); private: diff --git a/dom/plugins/PluginModuleChild.cpp b/dom/plugins/PluginModuleChild.cpp index 8534dfe8a62..019f1626c4a 100644 --- a/dom/plugins/PluginModuleChild.cpp +++ b/dom/plugins/PluginModuleChild.cpp @@ -736,10 +736,11 @@ _invalidaterect(NPP aNPP, AssertPluginThread(); PluginInstanceChild* actor = InstCast(aNPP); - actor->SendNPN_InvalidateRect(*aInvalidRect); + bool sendToParent = actor->InternalInvalidateRect(aInvalidRect); - // Some platforms need additional help to redraw in this process. - actor->InternalInvalidateRect(aInvalidRect); + if (sendToParent) { + actor->SendNPN_InvalidateRect(*aInvalidRect); + } } void NP_CALLBACK