Bug 1619778 - Remove unused `GeckoThread#waitOnGecko` methods. r=geckoview-reviewers,aklotz

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Willcox 2020-03-12 15:33:57 +00:00
Родитель 332ec2ba27
Коммит 97a1646a17
2 изменённых файлов: 0 добавлений и 36 удалений

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

@ -643,22 +643,6 @@ public class GeckoThread extends Thread {
"speculativeConnectNative", uri);
}
@WrapForJNI(stubName = "WaitOnGecko")
@RobocopTarget
private static native boolean nativeWaitOnGecko(long timeoutMillis);
public static void waitOnGeckoForever() {
nativeWaitOnGecko(0);
}
public static boolean waitOnGecko() {
return waitOnGecko(DEFAULT_TIMEOUT);
}
public static boolean waitOnGecko(final long timeoutMillis) {
return nativeWaitOnGecko(timeoutMillis);
}
@WrapForJNI(stubName = "OnPause", dispatchTo = "gecko")
private static native void nativeOnPause();

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

@ -141,26 +141,6 @@ class GeckoThreadSupport final
specConn->SpeculativeConnect(uri, principal, nullptr);
}
static bool WaitOnGecko(int64_t timeoutMillis) {
struct NoOpRunnable : Runnable {
NoOpRunnable() : Runnable("NoOpRunnable") {}
NS_IMETHOD Run() override { return NS_OK; }
};
struct NoOpEvent : nsAppShell::Event {
void Run() override {
// We cannot call NS_DispatchToMainThread from within
// WaitOnGecko itself because the thread that is calling
// WaitOnGecko may not be an nsThread, and may not be able to do
// a sync dispatch.
NS_DispatchToMainThread(do_AddRef(new NoOpRunnable()),
NS_DISPATCH_SYNC);
}
};
return nsAppShell::SyncRunEvent(
NoOpEvent(), nullptr, TimeDuration::FromMilliseconds(timeoutMillis));
}
static void OnPause() {
MOZ_ASSERT(NS_IsMainThread());