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: 2bwD36LarAv
--- 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();