Bug 1662836 - Expose detailed initialization failure reason for WebRender. r=kvark

We don't know why we see initialization failures in the telemetry which
makes it hard to investigate why users aren't getting WebRender and
instead fallback to basic. Let's expose the detailed error message
WebRender already generates and puts in the critical log.

Differential Revision: https://phabricator.services.mozilla.com/D89185
This commit is contained in:
Andrew Osmond
2020-09-08 02:03:26 +00:00
parent c63840b6bd
commit 272f98121e
14 changed files with 59 additions and 30 deletions

View File

@@ -58,7 +58,7 @@ KnowsCompositor* WebRenderLayerManager::AsKnowsCompositor() { return mWrChild; }
bool WebRenderLayerManager::Initialize(
PCompositorBridgeChild* aCBChild, wr::PipelineId aLayersId,
TextureFactoryIdentifier* aTextureFactoryIdentifier) {
TextureFactoryIdentifier* aTextureFactoryIdentifier, nsCString& aError) {
MOZ_ASSERT(mWrChild == nullptr);
MOZ_ASSERT(aTextureFactoryIdentifier);
@@ -71,13 +71,14 @@ bool WebRenderLayerManager::Initialize(
// reinitialization. We can expect to be notified again to reinitialize
// (which may or may not be using WebRender).
gfxCriticalNote << "Failed to create WebRenderBridgeChild.";
aError.AssignLiteral("FEATURE_FAILURE_WEBRENDER_INITIALIZE_IPDL");
return false;
}
TextureFactoryIdentifier textureFactoryIdentifier;
wr::MaybeIdNamespace idNamespace;
// Sync ipc
bridge->SendEnsureConnected(&textureFactoryIdentifier, &idNamespace);
bridge->SendEnsureConnected(&textureFactoryIdentifier, &idNamespace, &aError);
if (textureFactoryIdentifier.mParentBackend == LayersBackend::LAYERS_NONE ||
idNamespace.isNothing()) {
gfxCriticalNote << "Failed to connect WebRenderBridgeChild.";