Bug 1143575. Convert SetCurrentImage(nullptr) callers to call ClearAllImages instead. r=nical
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -192,23 +192,20 @@ PluginInstanceParent::ActorDestroy(Actor
#if defined(OS_WIN)
if (why == AbnormalShutdown) {
// If the plugin process crashes, this is the only
// chance we get to destroy resources.
SharedSurfaceRelease();
UnsubclassPluginWindow();
}
#endif
- // After this method, the data backing the remote surface may no
- // longer be valid. The X surface may be destroyed, or the shared
- // memory backing this surface may no longer be valid.
if (mFrontSurface) {
mFrontSurface = nullptr;
if (mImageContainer) {
- mImageContainer->SetCurrentImage(nullptr);
+ mImageContainer->ClearAllImages();
}
#ifdef MOZ_X11
FinishX(DefaultXDisplay());
#endif
}
}
NPError
@@ -634,17 +631,17 @@ PluginInstanceParent::RecvShow(const NPR
CairoImage::Data cairoData;
cairoData.mSize = surface->GetSize();
cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
cairoImage->SetData(cairoData);
container->SetCurrentImage(cairoImage);
}
else if (mImageContainer) {
- mImageContainer->SetCurrentImage(nullptr);
+ mImageContainer->ClearAllImages();
}
mFrontSurface = surface;
RecvNPN_InvalidateRect(updatedRect);
PLUGIN_LOG_DEBUG((" (RecvShow invalidated for surface %p)",
mFrontSurface.get()));