Bug 1041632 - Part 8: eliminate enclosing instance member access in PrefsHelper. r=ckitching

This commit is contained in:
Richard Newman 2014-07-21 10:24:15 -07:00
Родитель 651dc48d5e
Коммит e30402298a
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -23,8 +23,8 @@ public final class PrefsHelper {
private static final String LOGTAG = "GeckoPrefsHelper";
private static boolean sRegistered = false;
private static final SparseArray<PrefHandler> sCallbacks = new SparseArray<PrefHandler>();
private static int sUniqueRequestId = 1;
/* inner-access */ static final SparseArray<PrefHandler> sCallbacks = new SparseArray<PrefHandler>();
public static int getPref(String prefName, PrefHandler callback) {
return getPrefsInternal(new String[] { prefName }, callback);
@ -63,8 +63,9 @@ public final class PrefsHelper {
return;
}
EventDispatcher.getInstance().registerGeckoThreadListener(new GeckoEventListener() {
@Override public void handleMessage(String event, JSONObject message) {
GeckoEventListener listener = new GeckoEventListener() {
@Override
public void handleMessage(String event, JSONObject message) {
try {
PrefHandler callback;
synchronized (PrefsHelper.class) {
@ -78,6 +79,7 @@ public final class PrefsHelper {
callback = null;
}
}
if (callback == null) {
Log.d(LOGTAG, "Preferences:Data message had an unknown requestId; ignoring");
return;
@ -107,7 +109,8 @@ public final class PrefsHelper {
Log.e(LOGTAG, "Error handling Preferences:Data message", e);
}
}
}, "Preferences:Data");
};
EventDispatcher.getInstance().registerGeckoThreadListener(listener, "Preferences:Data");
sRegistered = true;
}