зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1041632 - Part 8: eliminate enclosing instance member access in PrefsHelper. r=ckitching
This commit is contained in:
Родитель
651dc48d5e
Коммит
e30402298a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче