Bug 1608301: Part 2 - Add an additional assertion type to XPCOMEventTarget and change them to throw AssertionErrors; r=geckoview-reviewers,snorp

Differential Revision: https://phabricator.services.mozilla.com/D65635

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Aaron Klotz 2020-03-09 19:23:16 +00:00
parent ef896c8896
commit 991c2ccac2

View File

@ -39,7 +39,13 @@ public final class XPCOMEventTarget extends JNIObject implements IXPCOMEventTarg
public static void assertOnLauncherThread() {
if (BuildConfig.DEBUG && !launcherThread().isOnCurrentThread()) {
throw new IllegalThreadStateException("Expected to be running on XPCOM launcher thread");
throw new AssertionError("Expected to be running on XPCOM launcher thread");
}
}
public static void assertNotOnLauncherThread() {
if (BuildConfig.DEBUG && launcherThread().isOnCurrentThread()) {
throw new AssertionError("Expected to not be running on XPCOM launcher thread");
}
}