From 97a1646a17cf44467c457846f4766e59cf1c0740 Mon Sep 17 00:00:00 2001 From: James Willcox Date: Thu, 12 Mar 2020 15:33:57 +0000 Subject: [PATCH] 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 --- .../java/org/mozilla/gecko/GeckoThread.java | 16 --------------- widget/android/nsAppShell.cpp | 20 ------------------- 2 files changed, 36 deletions(-) diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java index 5b7e418729cb..e785d9a54388 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java @@ -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(); diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index d77b942666f4..a379046a3fec 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -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());