Bug 1260243 - Add GeckoThread.waitOnGecko; r=snorp
GeckoThread.waitOnGecko blocks the current thread and waits for previous events on the Gecko thread to finish executing before continuing. This is implemented by synchronously running a dummy event on the Gecko thread. This patch also lets us get rid of sendEventToGeckoSync in GeckoAppShell.
This commit is contained in:
@@ -182,6 +182,14 @@ public:
|
||||
}
|
||||
specConn->SpeculativeConnect(uri, nullptr);
|
||||
}
|
||||
|
||||
static void WaitOnGecko()
|
||||
{
|
||||
struct NoOpEvent : nsAppShell::Event {
|
||||
void Run() override {}
|
||||
};
|
||||
nsAppShell::SyncRunEvent(NoOpEvent());
|
||||
}
|
||||
};
|
||||
|
||||
class GeckoAppShellSupport final
|
||||
|
||||
Reference in New Issue
Block a user