Bug 1647225 - Rename some local functions and variables. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D80448
This commit is contained in:
Kartikaya Gupta 2020-06-23 15:20:33 +00:00
Родитель f7b1476df6
Коммит 11ab3b57b8
4 изменённых файлов: 31 добавлений и 31 удалений

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

@ -49,7 +49,7 @@ async function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "15.0", "8");
await promiseStartupManager();
function checkBlacklist() {
function checkBlocklist() {
var failureId = {};
var status;
@ -164,7 +164,7 @@ async function run_test() {
Services.obs.addObserver(function(aSubject, aTopic, aData) {
// If we wait until after we go through the event loop, gfxInfo is sure to
// have processed the gfxItems event.
executeSoon(checkBlacklist);
executeSoon(checkBlocklist);
}, "blocklist-data-gfxItems");
mockGfxBlocklistItemsFromDisk("../data/test_gfxBlacklist_AllOS.json");

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

@ -288,7 +288,7 @@ static void RemovePrefForDriverVersion() {
Preferences::ClearUser(SUGGESTED_VERSION_PREF);
}
static OperatingSystem BlacklistOSToOperatingSystem(const nsAString& os) {
static OperatingSystem BlocklistOSToOperatingSystem(const nsAString& os) {
if (os.EqualsLiteral("WINNT 6.1"))
return OperatingSystem::Windows7;
else if (os.EqualsLiteral("WINNT 6.2"))
@ -330,7 +330,7 @@ static OperatingSystem BlacklistOSToOperatingSystem(const nsAString& os) {
return OperatingSystem::Unknown;
}
static GfxDeviceFamily* BlacklistDevicesToDeviceFamily(
static GfxDeviceFamily* BlocklistDevicesToDeviceFamily(
nsTArray<nsCString>& devices) {
if (devices.Length() == 0) return nullptr;
@ -347,7 +347,7 @@ static GfxDeviceFamily* BlacklistDevicesToDeviceFamily(
return deviceIds;
}
static int32_t BlacklistFeatureToGfxFeature(const nsAString& aFeature) {
static int32_t BlocklistFeatureToGfxFeature(const nsAString& aFeature) {
MOZ_ASSERT(!aFeature.IsEmpty());
if (aFeature.EqualsLiteral("DIRECT2D"))
return nsIGfxInfo::FEATURE_DIRECT2D;
@ -412,7 +412,7 @@ static int32_t BlacklistFeatureToGfxFeature(const nsAString& aFeature) {
return -1;
}
static int32_t BlacklistFeatureStatusToGfxFeatureStatus(
static int32_t BlocklistFeatureStatusToGfxFeatureStatus(
const nsAString& aStatus) {
if (aStatus.EqualsLiteral("STATUS_OK"))
return nsIGfxInfo::FEATURE_STATUS_OK;
@ -437,7 +437,7 @@ static int32_t BlacklistFeatureStatusToGfxFeatureStatus(
return nsIGfxInfo::FEATURE_STATUS_OK;
}
static VersionComparisonOp BlacklistComparatorToComparisonOp(
static VersionComparisonOp BlocklistComparatorToComparisonOp(
const nsAString& op) {
if (op.EqualsLiteral("LESS_THAN"))
return DRIVER_LESS_THAN;
@ -466,11 +466,11 @@ static VersionComparisonOp BlacklistComparatorToComparisonOp(
}
/*
Deserialize Blacklist entries from string.
Deserialize Blocklist entries from string.
e.g:
os:WINNT 6.0\tvendor:0x8086\tdevices:0x2582,0x2782\tfeature:DIRECT3D_10_LAYERS\tfeatureStatus:BLOCKED_DRIVER_VERSION\tdriverVersion:8.52.322.2202\tdriverVersionComparator:LESS_THAN_OR_EQUAL
*/
static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
static bool BlocklistEntryToDriverInfo(nsCString& aBlocklistEntry,
GfxDriverInfo& aDriverInfo) {
// If we get an application version to be zero, something is not working
// and we are not going to bother checking the blocklist versions.
@ -485,7 +485,7 @@ static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
}
nsTArray<nsCString> keyValues;
ParseString(aBlacklistEntry, '\t', keyValues);
ParseString(aBlocklistEntry, '\t', keyValues);
aDriverInfo.mRuleId =
NS_LITERAL_CSTRING("FEATURE_FAILURE_DL_BLACKLIST_NO_ID");
@ -516,7 +516,7 @@ static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
NS_LITERAL_CSTRING("FEATURE_FAILURE_DL_BLACKLIST_") + value;
aDriverInfo.mRuleId = blockIdStr.get();
} else if (key.EqualsLiteral("os")) {
aDriverInfo.mOperatingSystem = BlacklistOSToOperatingSystem(dataValue);
aDriverInfo.mOperatingSystem = BlocklistOSToOperatingSystem(dataValue);
} else if (key.EqualsLiteral("osversion")) {
aDriverInfo.mOperatingSystemVersion = strtoul(value.get(), nullptr, 10);
} else if (key.EqualsLiteral("desktopEnvironment")) {
@ -528,7 +528,7 @@ static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
} else if (key.EqualsLiteral("driverVendor")) {
aDriverInfo.mDriverVendor = dataValue;
} else if (key.EqualsLiteral("feature")) {
aDriverInfo.mFeature = BlacklistFeatureToGfxFeature(dataValue);
aDriverInfo.mFeature = BlocklistFeatureToGfxFeature(dataValue);
if (aDriverInfo.mFeature < 0) {
// If we don't recognize the feature, we do not want to proceed.
gfxCriticalErrorOnce(CriticalLog::DefaultOptions(false))
@ -537,7 +537,7 @@ static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
}
} else if (key.EqualsLiteral("featureStatus")) {
aDriverInfo.mFeatureStatus =
BlacklistFeatureStatusToGfxFeatureStatus(dataValue);
BlocklistFeatureStatusToGfxFeatureStatus(dataValue);
} else if (key.EqualsLiteral("driverVersion")) {
uint64_t version;
if (ParseDriverVersion(dataValue, &version))
@ -547,7 +547,7 @@ static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
if (ParseDriverVersion(dataValue, &version))
aDriverInfo.mDriverVersionMax = version;
} else if (key.EqualsLiteral("driverVersionComparator")) {
aDriverInfo.mComparisonOp = BlacklistComparatorToComparisonOp(dataValue);
aDriverInfo.mComparisonOp = BlocklistComparatorToComparisonOp(dataValue);
} else if (key.EqualsLiteral("model")) {
aDriverInfo.mModel = dataValue;
} else if (key.EqualsLiteral("product")) {
@ -585,7 +585,7 @@ static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
} else if (key.EqualsLiteral("devices")) {
nsTArray<nsCString> devices;
ParseString(value, ',', devices);
GfxDeviceFamily* deviceIds = BlacklistDevicesToDeviceFamily(devices);
GfxDeviceFamily* deviceIds = BlocklistDevicesToDeviceFamily(devices);
if (deviceIds) {
// Get GfxDriverInfo to adopt the devices array we created.
aDriverInfo.mDeleteDevices = true;
@ -598,15 +598,15 @@ static bool BlacklistEntryToDriverInfo(nsCString& aBlacklistEntry,
return true;
}
static void BlacklistEntriesToDriverInfo(nsTArray<nsCString>& aBlacklistEntries,
static void BlocklistEntriesToDriverInfo(nsTArray<nsCString>& aBlocklistEntries,
nsTArray<GfxDriverInfo>& aDriverInfo) {
aDriverInfo.Clear();
aDriverInfo.SetLength(aBlacklistEntries.Length());
aDriverInfo.SetLength(aBlocklistEntries.Length());
for (uint32_t i = 0; i < aBlacklistEntries.Length(); ++i) {
nsCString blacklistEntry = aBlacklistEntries[i];
for (uint32_t i = 0; i < aBlocklistEntries.Length(); ++i) {
nsCString blocklistEntry = aBlocklistEntries[i];
GfxDriverInfo di;
if (BlacklistEntryToDriverInfo(blacklistEntry, di)) {
if (BlocklistEntryToDriverInfo(blocklistEntry, di)) {
aDriverInfo[i] = di;
// Prevent di falling out of scope from destroying the devices.
di.mDeleteDevices = false;
@ -619,13 +619,13 @@ GfxInfoBase::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
if (strcmp(aTopic, "blocklist-data-gfxItems") == 0) {
nsTArray<GfxDriverInfo> driverInfo;
nsTArray<nsCString> blacklistEntries;
nsTArray<nsCString> blocklistEntries;
nsCString utf8Data = NS_ConvertUTF16toUTF8(aData);
if (utf8Data.Length() > 0) {
ParseString(utf8Data, '\n', blacklistEntries);
ParseString(utf8Data, '\n', blocklistEntries);
}
BlacklistEntriesToDriverInfo(blacklistEntries, driverInfo);
EvaluateDownloadedBlacklist(driverInfo);
BlocklistEntriesToDriverInfo(blocklistEntries, driverInfo);
EvaluateDownloadedBlocklist(driverInfo);
}
return NS_OK;
@ -1241,7 +1241,7 @@ GfxInfoBase::GetFeatureSuggestedDriverVersion(int32_t aFeature,
discardFailureId);
}
void GfxInfoBase::EvaluateDownloadedBlacklist(
void GfxInfoBase::EvaluateDownloadedBlocklist(
nsTArray<GfxDriverInfo>& aDriverInfo) {
int32_t features[] = {nsIGfxInfo::FEATURE_DIRECT2D,
nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS,
@ -1274,9 +1274,9 @@ void GfxInfoBase::EvaluateDownloadedBlacklist(
nsIGfxInfo::FEATURE_GL_SWIZZLE,
0};
// For every feature we know about, we evaluate whether this blacklist has a
// For every feature we know about, we evaluate whether this blocklist has a
// non-STATUS_OK status. If it does, we set the pref we evaluate in
// GetFeatureStatus above, so we don't need to hold on to this blacklist
// GetFeatureStatus above, so we don't need to hold on to this blocklist
// anywhere permanent.
int i = 0;
while (features[i]) {

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

@ -158,7 +158,7 @@ class GfxInfoBase : public nsIGfxInfo,
bool IsFeatureAllowlisted(int32_t aFeature) const;
void EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo);
void EvaluateDownloadedBlocklist(nsTArray<GfxDriverInfo>& aDriverInfo);
bool BuildFeatureStateLog(JSContext* aCx, const gfx::FeatureState& aFeature,
JS::MutableHandle<JS::Value> aOut);

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

@ -2019,18 +2019,18 @@ void GfxInfo::DescribeFeatures(JSContext* aCx, JS::Handle<JSObject*> aObj) {
val = JS::BooleanValue(dm->TextureSharingWorks());
JS_SetProperty(aCx, obj, "textureSharing", val);
bool blacklisted = false;
bool blocklisted = false;
if (nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo()) {
int32_t status;
nsCString discardFailureId;
if (SUCCEEDED(
gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS,
discardFailureId, &status))) {
blacklisted = (status != nsIGfxInfo::FEATURE_STATUS_OK);
blocklisted = (status != nsIGfxInfo::FEATURE_STATUS_OK);
}
}
val = JS::BooleanValue(blacklisted);
val = JS::BooleanValue(blocklisted);
JS_SetProperty(aCx, obj, "blacklisted", val);
}