Bug 1276810 follow-up - Backout the nsPresShell.cpp change to reduce infallibility coupling. r=milan
authorJonathan Watt <jwatt@jwatt.org>
Thu, 26 May 2016 12:31:14 +0100
changeset 339503 a9575284041e2bd8b8822c469012ce4df5739ef8
parent 339502 85d31bd76c19fe2e7d32eb9176d15f96fd2048e1
child 339504 403728f309ce77168d47d67e69e41aad284aabbd
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmilan
bugs1276810
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
Bug 1276810 follow-up - Backout the nsPresShell.cpp change to reduce infallibility coupling. r=milan
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -2918,18 +2918,19 @@ PresShell::ClearFrameRefs(nsIFrame* aFra
 
 already_AddRefed<gfxContext>
 PresShell::CreateReferenceRenderingContext()
 {
   nsDeviceContext* devCtx = mPresContext->DeviceContext();
   RefPtr<gfxContext> rc;
   if (mPresContext->IsScreen()) {
     rc = gfxContext::ForDrawTarget(gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget());
-    MOZ_RELEASE_ASSERT(rc, "ScreenReferenceDrawTarget never returns null and "
-                           "ForDrawTarget always succeeds with it");
+    if (!rc) {
+      return nullptr;
+    }
   } else {
     // We assume the devCtx has positive width and height for this call.
     // However, width and height, may be outside of the reasonable range
     // so rc may still be null.
     rc = devCtx->CreateRenderingContext();
     if (!rc) {
       return nullptr;
     }