Bug 1460699: Use an 's' rather than 'm' prefix for GfxInfo static variables. r=milan

This commit is contained in:
David Major 2018-05-14 11:16:50 -04:00
Родитель b1cbda2eea
Коммит 8c24450c7e
9 изменённых файлов: 58 добавлений и 58 удалений

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

@ -14,8 +14,8 @@ int32_t GfxDriverInfo::allFeatures = 0;
uint64_t GfxDriverInfo::allDriverVersions = ~(uint64_t(0));
GfxDeviceFamily* const GfxDriverInfo::allDevices = nullptr;
GfxDeviceFamily* GfxDriverInfo::mDeviceFamilies[DeviceFamilyMax];
nsAString* GfxDriverInfo::mDeviceVendors[DeviceVendorMax];
GfxDeviceFamily* GfxDriverInfo::sDeviceFamilies[DeviceFamilyMax];
nsAString* GfxDriverInfo::sDeviceVendors[DeviceVendorMax];
GfxDriverInfo::GfxDriverInfo()
: mOperatingSystem(OperatingSystem::Unknown),
@ -99,11 +99,11 @@ const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id)
NS_ASSERTION(id >= 0 && id < DeviceFamilyMax, "DeviceFamily id is out of range");
// If it already exists, we must have processed it once, so return it now.
if (mDeviceFamilies[id])
return mDeviceFamilies[id];
if (sDeviceFamilies[id])
return sDeviceFamilies[id];
mDeviceFamilies[id] = new GfxDeviceFamily;
GfxDeviceFamily* deviceFamily = mDeviceFamilies[id];
sDeviceFamilies[id] = new GfxDeviceFamily;
GfxDeviceFamily* deviceFamily = sDeviceFamilies[id];
switch (id) {
case IntelGMA500:
@ -332,17 +332,17 @@ const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id)
// Macro for assigning a device vendor id to a string.
#define DECLARE_VENDOR_ID(name, deviceId) \
case name: \
mDeviceVendors[id]->AssignLiteral(deviceId); \
sDeviceVendors[id]->AssignLiteral(deviceId); \
break;
const nsAString& GfxDriverInfo::GetDeviceVendor(DeviceVendor id)
{
NS_ASSERTION(id >= 0 && id < DeviceVendorMax, "DeviceVendor id is out of range");
if (mDeviceVendors[id])
return *mDeviceVendors[id];
if (sDeviceVendors[id])
return *sDeviceVendors[id];
mDeviceVendors[id] = new nsString();
sDeviceVendors[id] = new nsString();
switch (id) {
DECLARE_VENDOR_ID(VendorAll, "");
@ -359,5 +359,5 @@ const nsAString& GfxDriverInfo::GetDeviceVendor(DeviceVendor id)
DECLARE_VENDOR_ID(DeviceVendorMax, "");
}
return *mDeviceVendors[id];
return *sDeviceVendors[id];
}

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

@ -10,9 +10,9 @@
// Macros for adding a blocklist item to the static list.
#define APPEND_TO_DRIVER_BLOCKLIST(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId, suggestedVersion) \
mDriverInfo->AppendElement(GfxDriverInfo(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId, suggestedVersion))
sDriverInfo->AppendElement(GfxDriverInfo(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId, suggestedVersion))
#define APPEND_TO_DRIVER_BLOCKLIST2(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId) \
mDriverInfo->AppendElement(GfxDriverInfo(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId))
sDriverInfo->AppendElement(GfxDriverInfo(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId))
#define APPEND_TO_DRIVER_BLOCKLIST_RANGE(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, driverVersionMax, ruleId, suggestedVersion) \
do { \
@ -21,7 +21,7 @@
driverComparator == DRIVER_BETWEEN_INCLUSIVE_START); \
GfxDriverInfo info(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId, suggestedVersion); \
info.mDriverVersionMax = driverVersionMax; \
mDriverInfo->AppendElement(info); \
sDriverInfo->AppendElement(info); \
} while (false)
#define APPEND_TO_DRIVER_BLOCKLIST_RANGE_GPU2(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, driverVersionMax, ruleId, suggestedVersion) \
@ -31,7 +31,7 @@
driverComparator == DRIVER_BETWEEN_INCLUSIVE_START); \
GfxDriverInfo info(os, vendor, devices, feature, featureStatus, driverComparator, driverVersion, ruleId, suggestedVersion, false, true); \
info.mDriverVersionMax = driverVersionMax; \
mDriverInfo->AppendElement(info); \
sDriverInfo->AppendElement(info); \
} while (false)
@ -161,10 +161,10 @@ struct GfxDriverInfo
nsCString mRuleId;
static const GfxDeviceFamily* GetDeviceFamily(DeviceFamily id);
static GfxDeviceFamily* mDeviceFamilies[DeviceFamilyMax];
static GfxDeviceFamily* sDeviceFamilies[DeviceFamilyMax];
static const nsAString& GetDeviceVendor(DeviceVendor id);
static nsAString* mDeviceVendors[DeviceVendorMax];
static nsAString* sDeviceVendors[DeviceVendorMax];
nsString mModel, mHardware, mProduct, mManufacturer;

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

@ -39,10 +39,10 @@ using namespace mozilla::widget;
using namespace mozilla;
using mozilla::MutexAutoLock;
nsTArray<GfxDriverInfo>* GfxInfoBase::mDriverInfo;
nsTArray<dom::GfxInfoFeatureStatus>* GfxInfoBase::mFeatureStatus;
bool GfxInfoBase::mDriverInfoObserverInitialized;
bool GfxInfoBase::mShutdownOccurred;
nsTArray<GfxDriverInfo>* GfxInfoBase::sDriverInfo;
nsTArray<dom::GfxInfoFeatureStatus>* GfxInfoBase::sFeatureStatus;
bool GfxInfoBase::sDriverInfoObserverInitialized;
bool GfxInfoBase::sShutdownOccurred;
// Observes for shutdown so that the child GfxDriverInfo list is freed.
class ShutdownObserver : public nsIObserver
@ -59,23 +59,23 @@ public:
{
MOZ_ASSERT(strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0);
delete GfxInfoBase::mDriverInfo;
GfxInfoBase::mDriverInfo = nullptr;
delete GfxInfoBase::sDriverInfo;
GfxInfoBase::sDriverInfo = nullptr;
delete GfxInfoBase::mFeatureStatus;
GfxInfoBase::mFeatureStatus = nullptr;
delete GfxInfoBase::sFeatureStatus;
GfxInfoBase::sFeatureStatus = nullptr;
for (uint32_t i = 0; i < DeviceFamilyMax; i++) {
delete GfxDriverInfo::mDeviceFamilies[i];
GfxDriverInfo::mDeviceFamilies[i] = nullptr;
delete GfxDriverInfo::sDeviceFamilies[i];
GfxDriverInfo::sDeviceFamilies[i] = nullptr;
}
for (uint32_t i = 0; i < DeviceVendorMax; i++) {
delete GfxDriverInfo::mDeviceVendors[i];
GfxDriverInfo::mDeviceVendors[i] = nullptr;
delete GfxDriverInfo::sDeviceVendors[i];
GfxDriverInfo::sDeviceVendors[i] = nullptr;
}
GfxInfoBase::mShutdownOccurred = true;
GfxInfoBase::sShutdownOccurred = true;
return NS_OK;
}
@ -85,10 +85,10 @@ NS_IMPL_ISUPPORTS(ShutdownObserver, nsIObserver)
void InitGfxDriverInfoShutdownObserver()
{
if (GfxInfoBase::mDriverInfoObserverInitialized)
if (GfxInfoBase::sDriverInfoObserverInitialized)
return;
GfxInfoBase::mDriverInfoObserverInitialized = true;
GfxInfoBase::sDriverInfoObserverInitialized = true;
nsCOMPtr<nsIObserverService> observerService = services::GetObserverService();
if (!observerService) {
@ -634,9 +634,9 @@ GfxInfoBase::GetFeatureStatus(int32_t aFeature, nsACString& aFailureId, int32_t*
if (XRE_IsContentProcess()) {
// Use the cached data received from the parent process.
MOZ_ASSERT(mFeatureStatus);
MOZ_ASSERT(sFeatureStatus);
bool success = false;
for (const auto& fs : *mFeatureStatus) {
for (const auto& fs : *sFeatureStatus) {
if (fs.feature() == aFeature) {
aFailureId = fs.failureId();
*aStatus = fs.status();
@ -889,8 +889,8 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray<GfxDriverInfo>& info,
void
GfxInfoBase::SetFeatureStatus(const nsTArray<dom::GfxInfoFeatureStatus>& aFS)
{
MOZ_ASSERT(!mFeatureStatus);
mFeatureStatus = new nsTArray<dom::GfxInfoFeatureStatus>(aFS);
MOZ_ASSERT(!sFeatureStatus);
sFeatureStatus = new nsTArray<dom::GfxInfoFeatureStatus>(aFS);
}
nsresult
@ -912,7 +912,7 @@ GfxInfoBase::GetFeatureStatusImpl(int32_t aFeature,
return NS_OK;
}
if (mShutdownOccurred) {
if (sShutdownOccurred) {
// 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.
@ -943,8 +943,8 @@ GfxInfoBase::GetFeatureStatusImpl(int32_t aFeature,
if (aDriverInfo.Length()) {
status = FindBlocklistedDeviceInList(aDriverInfo, aSuggestedVersion, aFeature, aFailureId, os);
} else {
if (!mDriverInfo) {
mDriverInfo = new nsTArray<GfxDriverInfo>();
if (!sDriverInfo) {
sDriverInfo = new nsTArray<GfxDriverInfo>();
}
status = FindBlocklistedDeviceInList(GetGfxDriverInfo(), aSuggestedVersion, aFeature, aFailureId, os);
}

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

@ -81,10 +81,10 @@ public:
static void AddCollector(GfxInfoCollectorBase* collector);
static void RemoveCollector(GfxInfoCollectorBase* collector);
static nsTArray<GfxDriverInfo>* mDriverInfo;
static nsTArray<mozilla::dom::GfxInfoFeatureStatus>* mFeatureStatus;
static bool mDriverInfoObserverInitialized;
static bool mShutdownOccurred;
static nsTArray<GfxDriverInfo>* sDriverInfo;
static nsTArray<mozilla::dom::GfxInfoFeatureStatus>* sFeatureStatus;
static bool sDriverInfoObserverInitialized;
static bool sShutdownOccurred;
virtual nsString Model() { return EmptyString(); }
virtual nsString Hardware() { return EmptyString(); }

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

@ -260,10 +260,10 @@ const nsTArray<GfxDriverInfo>&
GfxInfo::GetGfxDriverInfo()
{
// Nothing here yet.
//if (!mDriverInfo->Length()) {
//if (!sDriverInfo->Length()) {
//
//}
return *mDriverInfo;
return *sDriverInfo;
}
nsresult
@ -282,7 +282,7 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
if (aOS)
*aOS = os;
if (mShutdownOccurred) {
if (sShutdownOccurred) {
return NS_OK;
}

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

@ -366,7 +366,7 @@ GfxInfo::AddCrashReportAnnotations()
const nsTArray<GfxDriverInfo>&
GfxInfo::GetGfxDriverInfo()
{
if (mDriverInfo->IsEmpty()) {
if (sDriverInfo->IsEmpty()) {
APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Android,
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAll), GfxDriverInfo::allDevices,
nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_STATUS_OK,
@ -374,7 +374,7 @@ GfxInfo::GetGfxDriverInfo()
"FEATURE_OK_FORCE_OPENGL" );
}
return *mDriverInfo;
return *sDriverInfo;
}
nsresult
@ -392,7 +392,7 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
if (aOS)
*aOS = os;
if (mShutdownOccurred) {
if (sShutdownOccurred) {
return NS_OK;
}

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

@ -309,7 +309,7 @@ GfxInfo::AddCrashReportAnnotations()
const nsTArray<GfxDriverInfo>&
GfxInfo::GetGfxDriverInfo()
{
if (!mDriverInfo->Length()) {
if (!sDriverInfo->Length()) {
IMPLEMENT_MAC_DRIVER_BLOCKLIST(OperatingSystem::OSX,
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices,
nsIGfxInfo::FEATURE_WEBGL_MSAA, nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION, "FEATURE_FAILURE_MAC_ATI_NO_MSAA");
@ -320,7 +320,7 @@ GfxInfo::GetGfxDriverInfo()
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(Geforce7300GT),
nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, "FEATURE_FAILURE_MAC_7300_NO_WEBGL");
}
return *mDriverInfo;
return *sDriverInfo;
}
nsresult
@ -338,7 +338,7 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
if (aOS)
*aOS = os;
if (mShutdownOccurred) {
if (sShutdownOccured) {
return NS_OK;
}

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

@ -152,14 +152,14 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
const nsTArray<GfxDriverInfo>&
GfxInfo::GetGfxDriverInfo()
{
if (mDriverInfo->IsEmpty()) {
if (sDriverInfo->IsEmpty()) {
APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Ios,
(nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAll), GfxDriverInfo::allDevices,
nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_STATUS_OK,
DRIVER_COMPARISON_IGNORED, GfxDriverInfo::allDriverVersions );
}
return *mDriverInfo;
return *sDriverInfo;
}
nsresult
@ -175,7 +175,7 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
if (aOS)
*aOS = OperatingSystem::Ios;
if (mShutdownOccurred) {
if (sShutdownOccured) {
return NS_OK;
}

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

@ -1010,7 +1010,7 @@ DetectBrokenAVX()
const nsTArray<GfxDriverInfo>&
GfxInfo::GetGfxDriverInfo()
{
if (!mDriverInfo->Length()) {
if (!sDriverInfo->Length()) {
/*
* It should be noted here that more specialized rules on certain features
* should be inserted -before- more generalized restriction. As the first
@ -1435,7 +1435,7 @@ GfxInfo::GetGfxDriverInfo()
nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "FEATURE_UNQUALIFIED_WEBRENDER_NVIDIA_8_1");
}
return *mDriverInfo;
return *sDriverInfo;
}
nsresult
@ -1453,7 +1453,7 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
if (aOS)
*aOS = os;
if (mShutdownOccurred) {
if (sShutdownOccured) {
return NS_OK;
}