Bug 1335745 - Guard against a null rootPresContext. r=tnikkel
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 23 Mar 2017 17:22:26 -0400
changeset 349767 e299338a1e4f1289c451d18d5d94e03129ad3e44
parent 349766 fabfa956af08398c59db5a2a051035bb36284b74
child 349768 4b47e1e71f378cba4ed5b66bb567da41d4fd0cd1
push id31561
push userkwierso@gmail.com
push dateMon, 27 Mar 2017 21:21:48 +0000
treeherdermozilla-central@a6f35285bd1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1335745
milestone55.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 1335745 - Guard against a null rootPresContext. r=tnikkel With WebRender enabled, the DidComposite notification message can be delayed because of the extra indirection of the WR Render thread. This can result in the DidComposite notification arriving for a popup window after it has already been put into the bfcache and no longer has a root prescontext. This results in an intermittent crash or assertion failure during crashtests. A null guard here should avoid the problem. MozReview-Commit-ID: A1U82tStFsQ
view/nsView.cpp
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -1077,18 +1077,19 @@ nsView::DidCompositeWindow(uint64_t aTra
                            const TimeStamp& aCompositeEnd)
 {
   nsIPresShell* presShell = mViewManager->GetPresShell();
   if (presShell) {
     nsAutoScriptBlocker scriptBlocker;
 
     nsPresContext* context = presShell->GetPresContext();
     nsRootPresContext* rootContext = context->GetRootPresContext();
-    MOZ_ASSERT(rootContext, "rootContext must be valid.");
-    rootContext->NotifyDidPaintForSubtree(aTransactionId, aCompositeEnd);
+    if (rootContext) {
+      rootContext->NotifyDidPaintForSubtree(aTransactionId, aCompositeEnd);
+    }
 
     // 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();