Bug 1237227 - Check the return of context->GetDisplayRootPresContext() for validity. r=roc
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Wed, 06 Jan 2016 04:32:00 -0500
changeset 316056 577396a6287e61572fcef25b255144d1199465f5
parent 316055 4b71ca98d12c5dc54d69ccf98fe1a11a6d47558a
child 316057 7ccd9c22dd043894f11aee24805a00f104ed1701
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1237227
milestone46.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 1237227 - Check the return of context->GetDisplayRootPresContext() for validity. r=roc
view/nsView.cpp
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -1082,17 +1082,19 @@ void
 nsView::DidCompositeWindow(const TimeStamp& aCompositeStart,
                            const TimeStamp& aCompositeEnd)
 {
   nsIPresShell* presShell = mViewManager->GetPresShell();
   if (presShell) {
     nsAutoScriptBlocker scriptBlocker;
 
     nsPresContext* context = presShell->GetPresContext();
-    context->GetDisplayRootPresContext()->GetRootPresContext()->NotifyDidPaintForSubtree(nsIPresShell::PAINT_COMPOSITE);
+    nsRootPresContext* rootContext = context->GetDisplayRootPresContext();
+    MOZ_ASSERT(rootContext, "rootContext must be valid.");
+    rootContext->GetRootPresContext()->NotifyDidPaintForSubtree(nsIPresShell::PAINT_COMPOSITE);
 
     // If the two timestamps are identical, this was likely a fake composite
     // event which wouldn't be terribly useful to display.
     if (aCompositeStart == aCompositeEnd) {
       return;
     }
 
     nsIDocShell* docShell = context->GetDocShell();