Bug 1000104 - Fix error handling in RecvSetAsyncScrollOffset - r=kats
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 23 Apr 2014 10:42:40 -0400
changeset 199384 663c5751c29edc541b4341da15652de0fba60cd6
parent 199383 6c4e8196edff0af43981a11f8a8cd2c82e6ddfa5
child 199385 e3bc878ad761c42c127176f16929e41f09582a05
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1000104
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,