Bug 1125325 - Follow-up to stop sending over bad values to the child process when a widget is not available. r=smaug
authorKartikaya Gupta <kgupta@mozilla.com>
Sun, 14 Jun 2015 12:19:55 -0400
changeset 248784 0f75f079159c3399962f106d2d9e79380ba3779b
parent 248783 6b19e87c2d0ac69e4d068c2f513897d293005a55
child 248785 2a0e025a2251ee1eda2ff4ee416242ca6c912b4d
push id61054
push userkgupta@mozilla.com
push dateSun, 14 Jun 2015 16:21:51 +0000
treeherdermozilla-inbound@0f75f079159c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1125325
milestone41.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 1125325 - Follow-up to stop sending over bad values to the child process when a widget is not available. r=smaug
dom/ipc/TabParent.cpp
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -965,36 +965,35 @@ TabParent::UpdateDimensions(const nsIntR
     return;
   }
   hal::ScreenConfiguration config;
   hal::GetCurrentScreenConfiguration(&config);
   ScreenOrientation orientation = config.orientation();
   LayoutDeviceIntPoint chromeOffset = -GetChildProcessOffset();
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
+  if (!widget) {
+    NS_WARNING("No widget found in TabParent::UpdateDimensions");
+    return;
+  }
   nsIntRect contentRect = rect;
-  if (widget) {
-    contentRect.x += widget->GetClientOffset().x;
-    contentRect.y += widget->GetClientOffset().y;
-  }
+  contentRect.x += widget->GetClientOffset().x;
+  contentRect.y += widget->GetClientOffset().y;
 
   if (!mUpdatedDimensions || mOrientation != orientation ||
       mDimensions != size || !mRect.IsEqualEdges(contentRect) ||
       chromeOffset != mChromeOffset) {
 
     mUpdatedDimensions = true;
     mRect = contentRect;
     mDimensions = size;
     mOrientation = orientation;
     mChromeOffset = chromeOffset;
 
-    CSSToLayoutDeviceScale widgetScale;
-    if (widget) {
-      widgetScale = widget->GetDefaultScale();
-    }
+    CSSToLayoutDeviceScale widgetScale = widget->GetDefaultScale();
 
     LayoutDeviceIntRect devicePixelRect =
       ViewAs<LayoutDevicePixel>(mRect,
                                 PixelCastJustification::LayoutDeviceIsScreenForTabDims);
     LayoutDeviceIntSize devicePixelSize =
       ViewAs<LayoutDevicePixel>(mDimensions.ToUnknownSize(),
                                 PixelCastJustification::LayoutDeviceIsScreenForTabDims);