Bug 1143575. Convert SetCurrentImage(nullptr) callers to call ClearAllImages instead. r=nical draft
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 26 Mar 2015 11:40:36 +1300
changeset 275568 df021e4d919062d889b0cc323e9824c7aa67228a
parent 275567 a4d9efef6b2937a831b83c8e937161b14b588d6e
child 275569 3e8b2379cefaca160390f400930797249273aed4
push id3189
push userrocallahan@mozilla.com
push dateFri, 03 Jul 2015 11:12:01 +0000
reviewersnical
bugs1143575
milestone42.0a1
Bug 1143575. Convert SetCurrentImage(nullptr) callers to call ClearAllImages instead. r=nical
dom/plugins/ipc/PluginInstanceParent.cpp
--- 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()));