import changes from tenfourfox:

- #500: M1458270 M1452576 M1459162 M1450688 M1456975 M1459693 M1464784 (14a6deb01)
This commit is contained in:
2018-06-15 20:28:21 +08:00
parent 6d3f890333
commit aea041461e
10 changed files with 76 additions and 29 deletions
+16 -2
View File
@@ -45,6 +45,7 @@ using mozilla::MutexAutoLock;
nsTArray<GfxDriverInfo>* GfxInfoBase::mDriverInfo;
bool GfxInfoBase::mDriverInfoObserverInitialized;
bool GfxInfoBase::mShutdownOccurred;
// Observes for shutdown so that the child GfxDriverInfo list is freed.
class ShutdownObserver : public nsIObserver
@@ -64,11 +65,17 @@ public:
delete GfxInfoBase::mDriverInfo;
GfxInfoBase::mDriverInfo = nullptr;
for (uint32_t i = 0; i < DeviceFamilyMax; i++)
for (uint32_t i = 0; i < DeviceFamilyMax; i++) {
delete GfxDriverInfo::mDeviceFamilies[i];
GfxDriverInfo::mDeviceFamilies[i] = nullptr;
}
for (uint32_t i = 0; i < DeviceVendorMax; i++)
for (uint32_t i = 0; i < DeviceVendorMax; i++) {
delete GfxDriverInfo::mDeviceVendors[i];
GfxDriverInfo::mDeviceVendors[i] = nullptr;
}
GfxInfoBase::mShutdownOccurred = true;
return NS_OK;
}
@@ -911,6 +918,13 @@ GfxInfoBase::GetFeatureStatusImpl(int32_t aFeature,
return NS_OK;
}
if (mShutdownOccurred) {
// This is futile; we've already commenced shutdown and our blocklists have
// been deleted. We may want to look into resurrecting the blocklist instead
// but for now, just don't even go there.
return NS_OK;
}
// If an operating system was provided by the derived GetFeatureStatusImpl,
// grab it here. Otherwise, the OS is unknown.
OperatingSystem os = DRIVER_OS_UNKNOWN;
+1
View File
@@ -72,6 +72,7 @@ public:
static nsTArray<GfxDriverInfo>* mDriverInfo;
static bool mDriverInfoObserverInitialized;
static bool mShutdownOccurred;
virtual nsString Model() { return EmptyString(); }
virtual nsString Hardware() { return EmptyString(); }
+4
View File
@@ -335,6 +335,10 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
if (aOS)
*aOS = os;
if (mShutdownOccurred) {
return NS_OK;
}
// Don't evaluate special cases when we're evaluating the downloaded blocklist.
if (!aDriverInfo.Length()) {
if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) {