Add diagnostics for the crash in bug 1387467. r=milan

This commit is contained in:
David Anderson 2017-08-05 01:32:25 -07:00
Родитель b5246ec0a4
Коммит 783e6ecfd6
2 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -132,6 +132,7 @@ enum class LogReason : int {
InvalidDrawTarget,
NativeFontResourceNotFound,
UnscaledFontNotFound,
InvalidLayerType,
// End
MustBeLessThanThis = 101,
};

Просмотреть файл

@ -148,6 +148,13 @@ FrameBuilder::ProcessContainerLayer(ContainerLayer* aContainer,
{
LayerMLGPU* layer = aContainer->AsHostLayer()->AsLayerMLGPU();
// Diagnostic information for bug 1387467.
if (!layer) {
gfxDevCrash(LogReason::InvalidLayerType) <<
"Layer type is invalid: " << aContainer->Name();
return false;
}
// We don't want to traverse containers twice, so we only traverse them if
// they haven't been prepared yet.
bool isFirstVisit = !layer->IsPrepared();
@ -171,6 +178,12 @@ FrameBuilder::ProcessContainerLayer(ContainerLayer* aContainer,
// RefLayers do not have intermediate surfaces so this is guaranteed
// to be a full-fledged ContainerLayerMLGPU.
ContainerLayerMLGPU* viewContainer = layer->AsContainerLayerMLGPU();
if (!viewContainer) {
gfxDevCrash(LogReason::InvalidLayerType) <<
"Container layer type is invalid: " << aContainer->Name();
return false;
}
if (isFirstVisit && !viewContainer->GetInvalidRect().IsEmpty()) {
// The RenderView constructor automatically attaches itself to the parent.
RefPtr<RenderViewMLGPU> view = new RenderViewMLGPU(this, viewContainer, aView);