Bug 889881 - Refactor and add a Gecko handler to ThreadUtils; r=blassey

This commit is contained in:
Jim Chen
2013-07-09 16:25:55 -04:00
parent 5bec75659c
commit aa0541a2ef
5 changed files with 13 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ public final class ThreadUtils {
private static Thread sBackgroundThread;
private static Handler sUiHandler;
private static Handler sGeckoHandler;
@SuppressWarnings("serial")
public static class UiThreadBlockedException extends RuntimeException {
@@ -55,8 +56,9 @@ public final class ThreadUtils {
sUiHandler = handler;
}
public static void setGeckoThread(Thread thread) {
public static void setGeckoThread(Thread thread, Handler handler) {
sGeckoThread = thread;
sGeckoHandler = handler;
}
public static void setBackgroundThread(Thread thread) {
@@ -79,6 +81,10 @@ public final class ThreadUtils {
return sGeckoThread;
}
public static Handler getGeckoHandler() {
return sGeckoHandler;
}
public static Thread getBackgroundThread() {
return sBackgroundThread;
}