Bug 1182017 - Call Send__delete__ immediately rather than through an event. r=nical, a=sledru
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 27 Aug 2015 15:40:35 +1200
changeset 289022 c850af52fbd84fc30a922eab459d38ae8b21b5d8
parent 289021 a22cde4e1152e45654ce4b79bdfc74a84a09f7bc
child 289023 3bb5c17c68568d4f9b2fe4e3715888926e588b1e
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, sledru
bugs1182017
milestone42.0a2
Bug 1182017 - Call Send__delete__ immediately rather than through an event. r=nical, a=sledru Kyle assures me it's safe to call Send__delete__ with references to 'this' on the stack.
gfx/layers/ipc/ImageContainerParent.cpp
--- a/gfx/layers/ipc/ImageContainerParent.cpp
+++ b/gfx/layers/ipc/ImageContainerParent.cpp
@@ -15,23 +15,16 @@ namespace layers {
 
 ImageContainerParent::~ImageContainerParent()
 {
   while (!mImageHosts.IsEmpty()) {
     mImageHosts[mImageHosts.Length() - 1]->SetImageContainer(nullptr);
   }
 }
 
-static void SendDeleteAndIgnoreResult(ImageContainerParent* self)
-{
-  unused << PImageContainerParent::Send__delete__(self);
-}
-
 bool ImageContainerParent::RecvAsyncDelete()
 {
-  MessageLoop::current()->PostTask(
-    FROM_HERE, NewRunnableFunction(&SendDeleteAndIgnoreResult, this));
-
+  unused << PImageContainerParent::Send__delete__(this);
   return true;
 }
 
 } // namespace layers
 } // namespace mozilla