diff --git a/dom/plugins/PluginInstanceChild.cpp b/dom/plugins/PluginInstanceChild.cpp index 589baf003902..5abe86626db3 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 234885658d8e..8a6878fdf4e2 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 8534dfe8a622..019f1626c4a7 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