Remove unused null widget checks. (bug 1269037 part 2, r=mchang)
authorDavid Anderson <danderson@mozilla.com>
Tue, 03 May 2016 17:40:19 -0700
changeset 295964 ff82b00b481ed96257bd93ce3e28e882a2f292b6
parent 295963 a5086ab888367112761074071ce56ce95ca7a113
child 295965 1738cb0de145f7cb689bb819900ff0de06bbf9da
push id76157
push userdanderson@mozilla.com
push dateWed, 04 May 2016 00:40:57 +0000
treeherdermozilla-inbound@ff82b00b481e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchang
bugs1269037
milestone49.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
Remove unused null widget checks. (bug 1269037 part 2, r=mchang)
widget/CompositorWidgetProxy.cpp
--- a/widget/CompositorWidgetProxy.cpp
+++ b/widget/CompositorWidgetProxy.cpp
@@ -65,153 +65,108 @@ CompositorWidgetProxy::GetGLFrameBufferF
 CompositorWidgetProxyWrapper::CompositorWidgetProxyWrapper(nsBaseWidget* aWidget)
  : mWidget(aWidget)
 {
 }
 
 bool
 CompositorWidgetProxyWrapper::PreRender(layers::LayerManagerComposite* aManager)
 {
-  if (!mWidget) {
-    return false;
-  }
   return mWidget->PreRender(aManager);
 }
 
 void
 CompositorWidgetProxyWrapper::PostRender(layers::LayerManagerComposite* aManager)
 {
-  if (!mWidget) {
-    return;
-  }
   mWidget->PostRender(aManager);
 }
 
 void
 CompositorWidgetProxyWrapper::DrawWindowUnderlay(layers::LayerManagerComposite* aManager,
                                                  LayoutDeviceIntRect aRect)
 {
-  if (!mWidget) {
-    return;
-  }
   mWidget->DrawWindowUnderlay(aManager, aRect);
 }
 
 void
 CompositorWidgetProxyWrapper::DrawWindowOverlay(layers::LayerManagerComposite* aManager,
                                                 LayoutDeviceIntRect aRect)
 {
-  if (!mWidget) {
-    return;
-  }
   mWidget->DrawWindowOverlay(aManager, aRect);
 }
 
 already_AddRefed<gfx::DrawTarget>
 CompositorWidgetProxyWrapper::StartRemoteDrawing()
 {
-  if (!mWidget) {
-    return nullptr;
-  }
   return mWidget->StartRemoteDrawing();
 }
 
 already_AddRefed<gfx::DrawTarget>
 CompositorWidgetProxyWrapper::StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
                                                          layers::BufferMode* aBufferMode)
 {
-  if (!mWidget) {
-    return nullptr;
-  }
   return mWidget->StartRemoteDrawingInRegion(aInvalidRegion, aBufferMode);
 }
 
 void
 CompositorWidgetProxyWrapper::EndRemoteDrawing()
 {
-  if (!mWidget) {
-    return;
-  }
   mWidget->EndRemoteDrawing();
 }
 
 void
 CompositorWidgetProxyWrapper::EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
                                                        LayoutDeviceIntRegion& aInvalidRegion)
 {
-  if (!mWidget) {
-    return;
-  }
   mWidget->EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion);
 }
 
 void
 CompositorWidgetProxyWrapper::CleanupRemoteDrawing()
 {
-  if (mWidget) {
-    mWidget->CleanupRemoteDrawing();
-  }
-  CompositorWidgetProxy::CleanupRemoteDrawing();
+  mWidget->CleanupRemoteDrawing();
 }
 
 void
 CompositorWidgetProxyWrapper::CleanupWindowEffects()
 {
-  if (!mWidget) {
-    return;
-  }
   mWidget->CleanupWindowEffects();
 }
 
 bool
 CompositorWidgetProxyWrapper::InitCompositor(layers::Compositor* aCompositor)
 {
-  if (!mWidget) {
-    return false;
-  }
   return mWidget->InitCompositor(aCompositor);
 }
 
 LayoutDeviceIntSize
 CompositorWidgetProxyWrapper::GetClientSize()
 {
-  if (!mWidget) {
-    return LayoutDeviceIntSize();
-  }
   return mWidget->GetClientSize();
 }
 
 uint32_t
 CompositorWidgetProxyWrapper::GetGLFrameBufferFormat()
 {
-  if (!mWidget) {
-    return CompositorWidgetProxy::GetGLFrameBufferFormat();
-  }
   return mWidget->GetGLFrameBufferFormat();
 }
 
 layers::Composer2D*
 CompositorWidgetProxyWrapper::GetComposer2D()
 {
-  if (!mWidget) {
-    return nullptr;
-  }
   return mWidget->GetComposer2D();
 }
 
 nsIWidget*
 CompositorWidgetProxyWrapper::RealWidget()
 {
   return mWidget;
 }
 
 already_AddRefed<CompositorVsyncDispatcher>
 CompositorWidgetProxyWrapper::GetCompositorVsyncDispatcher()
 {
-  if (!mWidget) {
-    return nullptr;
-  }
   RefPtr<CompositorVsyncDispatcher> cvd = mWidget->GetCompositorVsyncDispatcher();
   return cvd.forget();
 }
 
 } // namespace widget
 } // namespace mozilla