Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 5c3e6f6

Browse files
authored
Update FxR codebase to use inclusive language. Fixes #3492 (#3493)
1 parent f9f8606 commit 5c3e6f6

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void run() {
191191
private boolean mConnectionAvailable = true;
192192
private AudioManager mAudioManager;
193193
private Widget mActiveDialog;
194-
private Set<String> mPoorPerformanceWhiteList;
194+
private Set<String> mPoorPerformanceAllowList;
195195
private float mCurrentCylinderDensity = 0;
196196
private boolean mHideWebXRIntersitial = false;
197197

@@ -311,7 +311,7 @@ protected void onCreate(Bundle savedInstanceState) {
311311
GeolocationWrapper.INSTANCE.update(this);
312312

313313
mConnectivityReceiver = new ConnectivityReceiver();
314-
mPoorPerformanceWhiteList = new HashSet<>();
314+
mPoorPerformanceAllowList = new HashSet<>();
315315
checkForCrash();
316316

317317
mLifeCycle.setCurrentState(Lifecycle.State.CREATED);
@@ -1199,7 +1199,7 @@ private void handlePoorPerformance() {
11991199
return;
12001200
}
12011201
final String originalUri = window.getSession().getCurrentUri();
1202-
if (mPoorPerformanceWhiteList.contains(originalUri)) {
1202+
if (mPoorPerformanceAllowList.contains(originalUri)) {
12031203
return;
12041204
}
12051205
window.getSession().loadHomePage();
@@ -1209,7 +1209,7 @@ private void handlePoorPerformance() {
12091209
buttons,
12101210
(index, isChecked) -> {
12111211
if (index == PromptDialogWidget.NEGATIVE) {
1212-
mPoorPerformanceWhiteList.add(originalUri);
1212+
mPoorPerformanceAllowList.add(originalUri);
12131213
window.getSession().loadUri(originalUri);
12141214
}
12151215
});

app/src/common/shared/org/mozilla/vrbrowser/audio/AudioEngine.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class AudioEngine {
1515
private Context mContext;
1616
private AudioEngineImpl mEngine;
1717
private ConcurrentHashMap<Sound, Integer> mSourceIds;
18-
private float mMasterVolume = 1.0f;
18+
private float mMainVolume = 1.0f;
1919
private static ConcurrentHashMap<Context, AudioEngine> mEngines = new ConcurrentHashMap<>();
2020
private boolean mEnabled;
2121
private static final String LOGTAG = SystemUtils.createLogtag(AudioEngine.class);
@@ -123,13 +123,13 @@ public void playSound(Sound aSound) {
123123
playSound(aSound, 1.0f,false);
124124
}
125125

126-
public void setMasterVolume(float aVolume) {
127-
mMasterVolume = aVolume;
126+
public void setMainVolume(float aVolume) {
127+
mMainVolume = aVolume;
128128
}
129129

130130
public void playSound(Sound aSound, float aVolume, boolean aLoop) {
131131
if (mEnabled && mEngine != null) {
132-
mEngine.playSound(aSound, aVolume * mMasterVolume, aLoop);
132+
mEngine.playSound(aSound, aVolume * mMainVolume, aLoop);
133133
}
134134
}
135135

app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/WindowViewModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ public void onChanged(ObservableBoolean o) {
238238
@Override
239239
public void onChanged(Spannable url) {
240240
boolean isPrefEnabled = SettingsStore.getInstance(getApplication()).isServoEnabled();
241-
boolean isUrlWhiteListed = ServoUtils.isUrlInServoWhiteList(getApplication(), url.toString());
242-
isServoAvailable.postValue(new ObservableBoolean(isPrefEnabled && isUrlWhiteListed));
241+
boolean isUrlAllowListed = ServoUtils.isUrlInServoAllowList(getApplication(), url.toString());
242+
isServoAvailable.postValue(new ObservableBoolean(isPrefEnabled && isUrlAllowListed));
243243
}
244244
};
245245

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public class Windows implements TrayListener, TopBarWidget.Delegate, TitleBarWid
6969
private static final int TAB_SENT_NOTIFICATION_ID = 1;
7070
private static final int BOOKMARK_ADDED_NOTIFICATION_ID = 2;
7171

72-
// Restore URLs blacklist
73-
private static final List<String> SAVE_BLACKLIST = Stream.of(
72+
// Restore URLs blocklist
73+
private static final List<String> SAVE_BLOCKLIST = Stream.of(
7474
"https://accounts.firefox.com/oauth/"
7575
).collect(Collectors.toList());
7676

@@ -208,7 +208,7 @@ public void saveState() {
208208
ArrayList<Session> sessions = SessionStore.get().getSortedSessions(false);
209209
state.tabs = sessions.stream()
210210
.map(Session::getSessionState)
211-
.filter(sessionState -> SAVE_BLACKLIST.stream().noneMatch(uri ->
211+
.filter(sessionState -> SAVE_BLOCKLIST.stream().noneMatch(uri ->
212212
sessionState.mUri != null && sessionState.mUri.startsWith(uri)
213213
))
214214
.collect(Collectors.toCollection(ArrayList::new));

app/src/common/shared/org/mozilla/vrbrowser/utils/ServoUtils.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
public class ServoUtils {
1414
private static final String SESSION_CLASSNAME = "org.mozilla.servo.ServoSession";
15-
private static final String WHITELIST_CLASSNAME = "org.mozilla.servo.ServoWhiteList";
15+
private static final String ALLOWLIST_CLASSNAME = "org.mozilla.servo.ServoAllowList";
1616
private static final String LOGTAG = "ServoUtils";
17-
private static Object mServoWhiteList = null;
17+
private static Object mServoAllowList = null;
1818
private static long mVRContext;
1919

2020
public static boolean isServoAvailable() {
@@ -50,18 +50,18 @@ public static GeckoSession createServoSession(Context context) {
5050
}
5151
}
5252

53-
public static boolean isUrlInServoWhiteList(Context context, String url) {
53+
public static boolean isUrlInServoAllowList(Context context, String url) {
5454
if (isServoAvailable()) {
5555
try {
56-
Class clazz = Class.forName(WHITELIST_CLASSNAME);
57-
if (mServoWhiteList == null) {
56+
Class clazz = Class.forName(ALLOWLIST_CLASSNAME);
57+
if (mServoAllowList == null) {
5858
Constructor<?> constructor = clazz.getConstructor(Context.class);
59-
mServoWhiteList = constructor.newInstance(context);
59+
mServoAllowList = constructor.newInstance(context);
6060
}
6161
Method isAllowed = clazz.getMethod("isAllowed", String.class);
62-
return (boolean) isAllowed.invoke(mServoWhiteList, url);
62+
return (boolean) isAllowed.invoke(mServoAllowList, url);
6363
} catch (Exception e) {
64-
Log.e(LOGTAG, "Failed to call ServoWhiteList::isAllowed: " + e);
64+
Log.e(LOGTAG, "Failed to call ServoAllowList::isAllowed: " + e);
6565
return false;
6666
}
6767
} else {

servo/src/main/java/org/mozilla/servo/ServoWhiteList.java renamed to servo/src/main/java/org/mozilla/servo/ServoAllowList.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import java.util.regex.Pattern;
99
import java.util.stream.Stream;
1010

11-
public class ServoWhiteList {
11+
public class ServoAllowList {
1212
private final Pattern[] mRules;
1313

14-
public ServoWhiteList(Context context) {
14+
public ServoAllowList(Context context) {
1515
Resources res = context.getResources();
1616
Stream<String> rules = Stream.of(res.getStringArray(R.array.servo_white_list));
1717
mRules = rules.map(Pattern::compile).toArray(Pattern[]::new);
@@ -20,4 +20,4 @@ public ServoWhiteList(Context context) {
2020
public boolean isAllowed(String url) {
2121
return url != null && Stream.of(mRules).anyMatch(r -> r.matcher(url).matches());
2222
}
23-
}
23+
}

0 commit comments

Comments
 (0)