Bug 1000104 - Fix error handling in RecvSetAsyncScrollOffset - r=kats
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 23 Apr 2014 10:42:40 -0400
changeset 180221 663c5751c29edc541b4341da15652de0fba60cd6
parent 180220 6c4e8196edff0af43981a11f8a8cd2c82e6ddfa5
child 180222 e3bc878ad761c42c127176f16929e41f09582a05
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerskats
bugs1000104
milestone31.0a1
Bug 1000104 - Fix error handling in RecvSetAsyncScrollOffset - r=kats
gfx/layers/ipc/LayerTransactionParent.cpp
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -669,23 +669,27 @@ LayerTransactionParent::RecvGetAnimation
 bool
 LayerTransactionParent::RecvSetAsyncScrollOffset(PLayerParent* aLayer,
                                                  const int32_t& aX, const int32_t& aY)
 {
   if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
     return false;
   }
 
-  ContainerLayer* layer = cast(aLayer)->AsLayer()->AsContainerLayer();
+  Layer* layer = cast(aLayer)->AsLayer();
   if (!layer) {
-    return true;
+    return false;
   }
-  AsyncPanZoomController* controller = layer->GetAsyncPanZoomController();
+  ContainerLayer* containerLayer = layer->AsContainerLayer();
+  if (!containerLayer) {
+    return false;
+  }
+  AsyncPanZoomController* controller = containerLayer->GetAsyncPanZoomController();
   if (!controller) {
-    return true;
+    return false;
   }
   controller->SetTestAsyncScrollOffset(CSSPoint(aX, aY));
   return true;
 }
 
 bool
 LayerTransactionParent::Attach(ShadowLayerParent* aLayerParent,
                                CompositableParent* aCompositable,