Page MenuHomePhabricator

Bug 1698732 - Change reftest-content to get Azure info without Win32k APIs
ClosedPublic

Authored by cmartin on Apr 13 2021, 5:31 PM.
Referenced Files
Unknown Object (File)
Mon, Apr 21, 2:53 PM
Unknown Object (File)
Sat, Apr 19, 5:25 AM
Unknown Object (File)
Fri, Apr 18, 10:36 PM
Unknown Object (File)
Jan 3 2025, 2:04 AM
Unknown Object (File)
Jun 2 2024, 3:26 PM
Subscribers

Details

Summary

Currently, reftest-content uses GfxInfo::GetInfo() to obtain information about
the Azure backend. GetInfo() uses Win32k APIs, and therefore will mostly
return garbage in content processes.

This adds a new way to obtain the same information directly from GfxInfo
without using Win32k APIs.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable
Build Status
Buildable 315542
Build 409292: arc lint + arc unit

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Hey guys,

This change is mostly to remove usage of GfxInfo::GetInfo() in content, which uses Win32k APIs (which fail when Win32k Lockdown is enabled)

There are a couple more changes coming after this to remove another usage I found, and then finally to forbid the usage by adding a bunch of assertions.

Thanks!

emilio added a subscriber: jrmuizel.

This looks sensible to me though I'm not the most familiar with this code. Maybe Jeff can review it? @jrmuizel if you don't have the context or cycles or what not feel free to put the patch back in my review queue and I'll do my best :-). Thanks!

layout/tools/reftest/reftest-content.js
1484

Doesn't this throw on non-windows?

I'm on parental leave.

bas added inline comments.
layout/tools/reftest/reftest-content.js
1484

Agreed, this feels to me like this should be in a try-catch.

This revision is now accepted and ready to land.Apr 14 2021, 10:27 PM
cmartin added inline comments.
layout/tools/reftest/reftest-content.js
1484

You both were absolutely right -- Good catch! I don't know why I made this stupid mistake, but these fields were never meant to *only* work on Windows -- They should always work on all platforms!

This actually makes this code change smaller, since now I can implement the function in GfxInfoBase instead of the individual platform implementations.

emilio added inline comments.
layout/tools/reftest/reftest-content.js
1481

This change seems a bit unrelated, either change the commit message to cover it, or move it to another patch?

widget/GfxInfoBase.cpp
1814

CopyAsciiToUTF16 would be slightly more efficient I think, but not that it matters.

cmartin marked an inline comment as done.

Address more review concerns

cmartin added inline comments.
layout/tools/reftest/reftest-content.js
1481

Fair enough -- I will move it somewhere else and keep this change more focused.

widget/GfxInfoBase.cpp
1814

Didn't even know this existed. Done!

cmartin marked 2 inline comments as done.

Rebase